Python hide ticks but show tick labels

前端 未结 9 799
Happy的楠姐
Happy的楠姐 2020-12-07 11:23

I can remove the ticks with

ax.set_xticks([]) 
ax.set_yticks([]) 

but this removes the labels as well. Any way I can plot the tick labels b

9条回答
  •  失恋的感觉
    2020-12-07 11:56

    While attending a coursera course on Python, this was a question.

    Below is the given solution, which I think is more readable and intuitive.

    ax.tick_params(top='off', bottom='off', left='off', right='off', labelleft='on', labelbottom='on')
    

提交回复
热议问题