Skip to content
Advertisement

Hide tick label values but keep axis labels

I have this image:

JavaScript

enter image description here

I want to hide the numbers; if I use:

JavaScript

…I get this image:

enter image description here

It also hide the labels, V and t. How can I keep the labels while hiding the values?

Advertisement

Answer

If you use the matplotlib object-oriented approach, this is a simple task using ax.set_xticklabels() and ax.set_yticklabels(). Here we can just set them to an empty list to remove any labels:

JavaScript

If you also want to remove the tick marks as well as the labels, you can use ax.set_xticks() and ax.set_yticks() and set those to an empty list as well:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement