Will Vousden
Will Vousden

Reputation: 33348

No minor grid lines on the x-axis only

I'm trying to product a plot in which the y-axis has both major and minor gridlines, while the x-axis has only major gridlines.

It's straightforward enough to disable minor grid lines on both axes, like so:

axes.grid(False, which='minor')

But I can't find a way of applying this to only one axis. Am I missing something?

Upvotes: 7

Views: 2056

Answers (1)

GWW
GWW

Reputation: 44093

axes.yaxis.grid(True, which='minor') 

Similarly

axes.xaxis.grid(False, which='minor')

Upvotes: 11

Related Questions