在轴上获取刻度

时间:2019-08-05 02:41:27

标签: python matplotlib

我一直在努力获取Y轴上的价格变动,但由于某些原因,它们没有出现在情节上。更准确地说,我使用Subplot1.tick_params(axis ='y',direction ='out',length = 5,width = 3,colors ='grey')在Y上打勾。有人可以快速浏览下面的代码,并请对此有所了解。提前非常感谢!

plt.style.use('seaborn-notebook')
Figure1 = plt.figure('testplot', figsize=(5,4), dpi=300)
Subplot1 = Figure1.add_subplot(1,1,1)

n = np.random.rand(45)
Subplot1.plot(n,np.sin(n))

Subplot1.spines['left'].set_color('k')
Subplot1.tick_params(axis='y', direction='out', length=5, width=3, colors='grey')
Subplot1.set_facecolor('white')
Figure1.subplots_adjust(bottom=0.13, left=0.13, top=0.82, right=0.92,  wspace=0.2, hspace=0.2)
Figure1.savefig('testplot' + '.tiff', dpi=300)`

0 个答案:

没有答案