Skip to content

Instantly share code, notes, and snippets.

@Trevol
Created May 15, 2019 12:19
Show Gist options
  • Save Trevol/0d154001a8c781cbdb8d2ea4490455a2 to your computer and use it in GitHub Desktop.
Save Trevol/0d154001a8c781cbdb8d2ea4490455a2 to your computer and use it in GitHub Desktop.
Matplotlib.pyplot: on/off ticks, labels and tune other tick params
from matplotlib import pyplot as plt
plt.plot(range(10))
plt.tick_params(
axis='x', # changes apply to the x-axis
which='both', # both major and minor ticks are affected
bottom=False, # ticks along the bottom edge are off
top=False, # ticks along the top edge are off
labelbottom=False) # labels along the bottom edge are off
plt.show()
plt.savefig('plot')
plt.clf()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment