+2 votes
in Programming Languages by (75.1k points)

I enabled minor ticks on my plot using minorticks_on(). It put ticks on both x and y axis. I don't want ticks on x-axis. How can I remove xticks?

1 Answer

+2 votes
by (353k points)
selected by
Best answer

You can use tick_params() method to turn off ticks on the x-axis. Have a look at the list of parameters of tick_params() and make changes accordingly.

import matplotlib.pyplot as plt

plt.tick_params('x', which='both', bottom=False, top=False)