import matplotlib.pyplot as plt
# plt.plot([1,2,3,4,5],[3,1,5,6,9],'ro')
# plt.show()
# x = range(1, 15)
# y = range(1, 42, 3)
# plt.plot(x, y, color='y')
# y = range(5,19)
# plt.plot(x, y, color='r', linestyle='--') # 双划线
# plt.show()
# plt.plot([1,2,3,4,5],[3,1,5,6,9],'r1')
# plt.show()
# plt.figure(facecolor='yellow', figsize=(10, 6))
# x = range(1, 15)
# y = range(1, 42, 3)
# plt.xlabel('x轴测试')
# plt.ylabel('y轴测试')
# plt.plot(x, y, marker='o', color='b')
# plt.show()
# 设置坐标轴的刻度
import matplotlib.pyplot as plt
import random
x = [i for i in range(1,11)]
y = [random.randint(1,10) for _ in range(10)]
plt.plot(x,y, marker='o',mfc='w')
plt.xticks(range(1,11))
plt.show()
标签:plot,plt,show,color,50matplotlib,range,import
From: https://www.cnblogs.com/socoo-/p/17020002.html