Turn off the upper/right axis tick marks

前端 未结 4 1463
天涯浪人
天涯浪人 2020-12-17 11:16

I want to make the ticks on the right and upper axis invisible and am not sure what the third line should be:

import matplotlib.pyplot as plt
plt.plot(X,Y)
#         


        
4条回答
  •  庸人自扰
    2020-12-17 11:22

    Have a look at http://matplotlib.sourceforge.net/examples/pylab_examples/spine_placement_demo.html

    import pylab as p
    t = p.arange(0.0, 2.0, 0.01)
    ax=p.subplot(111)
    s = p.sin(2*p.pi*t)
    ax.plot(t, s, color='r',linewidth=1.0)
    ax.xaxis.set_ticks_position('bottom')
    ax.yaxis.set_ticks_position('left')
    p.show()
    

提交回复
热议问题