Tick Marks Do Not Disappear - IMPROVING PLOT AESTHETICS

I added

ax.tick_params(bottom="off", top="off", left="off", right="off")

expecting to see the tick marks disappear (in my Jupyter Notebook), but they did not disappear. In the Dataquest code window, however, they did disappear.

I tried looking for a way to make the tick marks disappear, and couldn’t find anything I could understand. I ended up changing the color of the tick marks to ‘white,’ as a work-around:

ax.tick_params(bottom='off', top='off', left='off', right='off', color='white')

Could someone explain to me how I should get the tick marks to disappear without having to resort to changing their color?

Hi @eroggenburg. This sounds like a matplotlib version issue. I think the version of matplotlib being used on DQ’s platform is 1.5.1, which uses these parameter values for ax.tick_params. However, in later versions of matplotlib, there is a change: instead of using on/off, it uses a bool. (Here is the documentation for version 1.5.1, and here is the documentation for version 3.1.3 for comparison.)

I have 3.1.3 on my system, and 'off' doesn’t work, but changing to False does.

You can check out this post to find out more about version information in your coding environment.

I hope that helps.

1 Like

Thank you, April. I will give it a shot!