2
我绘制了下图。是否有可能使长度为2的单位数字&身高1单位?也有可能将plt.xlabel('time(s)')更改为plt.xlabel('$ \ alpha \ rightarrow $')?如何在Matplotlib中制作图形矩形
import matplotlib.pyplot as plt
import numpy as np
t=[0,1,2]
s=[0.05,0.1,0.2]
plt.plot(t, s)
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
#plt.title('About as simple as it gets, folks')
plt.grid(True)
plt.savefig("test.png")
plt.show()
关于你提到的第二个问题,你只需要一个原始字符串:'plt.xlabel(R '$ \阿尔法\ $ RIGHTARROW')' – bernie
你能澄清你的第一个问题? – bernie
谢谢。第一个问题可以通过plt.figure来解决(figsize =(8,5)) – user5020