码迷,mamicode.com
首页 > 其他好文 > 详细

matplotlib删除x轴

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

标签:des   class   blog   http   tar   ext   

组内有个同事,有个奇怪的需求需要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轴

标签:des   class   blog   http   tar   ext   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!