I want to hide my ticks label on a plot I created, but keep this tick itself (the little marks on the axis). When I try to use what I\'ve found here, for example, the entire
I didn't find divenex's answer to work for me. This answer creates ticks without triggering any automatic labeling, hence no requirement to use "labelbottom= False":
if the bottom and left ticks already exist:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
plt.plot([1,2,3],[4,5,6])
ax.tick_params(right= True,top= True)
if no ticks already exist:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
plt.plot([1,2,3],[4,5,6])
ax.tick_params(right= True,top= True,left= True, bottom= True)