Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matplotlibrc has no effect on the plot?

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?

like image 430
Mato Avatar asked Sep 11 '25 08:09

Mato


1 Answers

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!

like image 139
Tödd Avatar answered Sep 13 '25 23:09

Tödd