首页 > 其他 > 详细

matplotlib删除x轴

时间:2014-06-18 08:55:05      阅读:898      评论:0      收藏:0      [点我收藏+]

组内有个同事,有个奇怪的需求需要matplotlib删除x轴

效果图如下:

bubuko.com,布布扣

关键代码:

from matplotlib import pyplot as plt
plt.plot(range(10))
plt.tick_params(    axis=‘x‘,          # changes apply to the x-axis
    which=‘both‘,      # both major and minor ticks are affected
    bottom=‘off‘,      # ticks along the bottom edge are off
    top=‘off‘,         # ticks along the top edge are off
    labelbottom=‘off‘) # labels along the bottom edge are off
plt.show()
plt.savefig(‘plot‘)
plt.clf()

 参考资料:

http://stackoverflow.com/questions/12998430/remove-xticks-in-a-matplot-lib-plot

 

matplotlib删除x轴,布布扣,bubuko.com

matplotlib删除x轴

原文:http://www.cnblogs.com/gsblog/p/3793379.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!