50matplotlib

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.yticks(range(1,11))
plt.show()

posted @ 2023-01-02 15:42  __username  阅读(18)  评论(0编辑  收藏  举报

本文作者:DIVMonster

本文链接:https://www.cnblogs.com/guangzan/p/12886111.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。