+2 votes
in Programming Languages by (7.8k 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

0 votes
by (15.1k points)

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)

 

...