import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Bad key "text.kerning_factor" on line 4 in /home/samyak/anaconda3/lib/python3.7/site-packages/matplotlib/mpl-data/stylelib/_classic_test_patch.mplstyle. You probably need to get an updated matplotlibrc file from https://github.com/matplotlib/matplotlib/blob/v3.1.3/matplotlibrc.template or from the matplotlib source distribution
I noticed the version of matplotlib
that print(matplotlib.__version__)
returned was different from the version that pip show matplotlib
showed! When I checked the folder ./Anaconda3/Lib/site-packages
I noticed there were two versions of matplotlib
(and a few other packages, too). For some reason when I upgraded matplotlib
(and other packages), the old versions were not uninstalled. I used
pip uninstall matplotlib
twice to remove both versions, then installed matplotlib again. This solved the problem.
It seems to be the case that one of style config files is for matplotlib 3.1 despite that 3.2 is installed.
Go to /home/samyak/anaconda3/lib/python3.7/site-packages/matplotlib/mpl-data/stylelib/
open _classic_test_patch.mplstyle
and comment out the line of text.kerning_factor:6
It worked for me.
I had the same problem and I solved it by upgrading Matplotlib using the code:
conda upgrade matplotlib
or
pip install --upgrade matplotlib
I encountered the same issue today (using version 3.2.1).
My solution: Reinstall matplotlib :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With