Reputation: 174
I'm trying to remove the xtick and ytick so that the final diagram looks like below. I want to keep the guide lines so that it would be easier for referencing. However, in Matplotlib, once you remove the xtick or ytick using the ax.set_xticks([])
or ax.set_yticks([])
method, the grid also disappears. Is there a way to make the plt.grid()
function not infer from the xticks or yticks? Any suggestion is much appreciated! Thanks!
Upvotes: 0
Views: 81
Reputation: 153510
Try setting the visibilty:
xticklines = ax.get_xticklines()
for i in xticklines:
i.set_visible(False)
Upvotes: 1