Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法从图中删除 x/y 轴数字(值)?我仍然想在情节中保留框架和网格。/乔纳斯
取决于您如何创建绘图...最简单的方法是将 xaxis 刻度设置为空列表
from matplotlib import pylab x = [1,2,3,4,5] y = [2,4,6,8,10] pylab.plot(x,y) frame = pylab.gca() frame.axes.get_xaxis().set_ticks([]) frame.axes.get_yaxis().set_ticks([]) pylab.show()