I want to change the look of my default plots in Python, so I created the file matplotlibrc in the current working directory (Windows 7). The file gets loaded -
import matplotlib as mp
print('Config. file loaded from:', mp.matplotlib_fname())
returns
Config. file loaded from: C:\Users\mato\Documents\Python_Scripts\matplotlibrc
however, the plot is unaffected.
The simple code:
import matplotlib.pyplot as plt
x = [1,2,3,4,5]
plt.plot(x)
with the matplotlibrc file that looks like this:
lines.linestyle : --
axes.grid : True
yields the plot with the solid line and no grid in the plot. What am I missing?
I had the same problem and the solution was to simply uncomment the commands.(remove the "#" before the parameter you want to be changed) Oh man!
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