Hide axis values but keep axis tick labels in matplotlib

前端 未结 6 1317
星月不相逢
星月不相逢 2021-01-30 06:13

I have this image:

plt.plot(sim_1[\'t\'],sim_1[\'V\'],\'k\')
plt.ylabel(\'V\')
plt.xlabel(\'t\')
plt.show()

I want to hide the numbers

6条回答
  •  无人共我
    2021-01-30 06:50

    to remove tickmarks entirely use:

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

    otherwise ax.set_yticklabels([]) and ax.set_xticklabels([]) will keep tickmarks.

提交回复
热议问题