Matplotlibrc doesn't affect the plot?

I want to change the look of my default plots in Python, so I created a matplotlibrc file in my current working directory (Windows 7). File uploading -

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 not affected.

Simple code:

import matplotlib.pyplot as plt
x = [1,2,3,4,5]
plt.plot(x)

      

with a matplotlibrc file that looks like this:

lines.linestyle   : --
axes.grid         : True

      

gives a graph with a solid line and grid on the graph. What am I missing?

+3


source to share


1 answer


I had the same problem and the solution was to simply uncomment the commands. (remove the "#" in front of the parameter you want to change) Oh man!



0


source







All Articles