Thorsten
Thorsten

Reputation: 333

Python Matplotlib remove xlabels but not grid

Is there a way to remove the labels of the x axis, but not the grid lines?

Both solutions to remove the labels also removed my grid lines.

I tried: axes.get_xaxis().set_visible(False) and axes.get_xaxis().set_ticks([])

Upvotes: 1

Views: 104

Answers (1)

Alvaro Fuentes
Alvaro Fuentes

Reputation: 17485

Try this: axes.xaxis.set_tick_params(label1On=False)

Upvotes: 2

Related Questions