plot参数
其代码如下:
import matplotlib.pyplot as plt
import randomx = ['2001', '2002', '2003', '2004', '2005']
y1 = [32000, 43243, 64323, 34567, 34567]
y2 = [24000, 34560, 24567, 12321, 24356]
y3 = [12345, 23456, 23421, 11111, 12344]
y4 = [45321, 46789, 65432, 43532, 43212]
plt.plot(x, y1, color='red', linestyle='-', linewidth=10)
plt.plot(x, y2, color='blue', linestyle='--', linewidth=25)
plt.plot(x, y3, color='g', linestyle=':', linewidth=15)
plt.plot(x, y4, color='c', linestyle='-.')
plt.xlabel("years")
plt.ylabel("data")
plt.show()
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-np.pi, np.pi, 64, endpoint=True)
y1 = np.sin(x)
y2 = np.cos(x)
plt.plot(x, y1, '*', color='r')
plt.plot(x, y2, 's', color='b')
plt.show()
赞 (0)