Andres Cala
Andres Cala

Reputation: 75

how to add grid lines in just one axis using a matplotlibrc file

I am trying to define a style in a matplotlibrc file which only shows grids on the y axis. If I do the following

axis.grid: True

both, the x and y axis will have grid.Is there a way of doing something like:

axis.Yaxis: True

I did not find anything like that in the documentation.

I am using Python 3.4

Upvotes: 3

Views: 1102

Answers (1)

ImportanceOfBeingErnest
ImportanceOfBeingErnest

Reputation: 339795

There is no rc parameter to change the grid on each axis individually. However you may turn only activate it for one specific axes

Options are to set the grid on globally and turn it off for the x axis

plt.rcParams["axes.grid"] =True
plt.rcParams["axes.grid.axis"] ="y"

or in the matplotlib rc file:

axes.grid.axis : y
axes.grid : True

Upvotes: 2

Related Questions