用Python绘制分布(折线)图

更新时间:2023-06-25 06:08:29 阅读: 评论:0

⽤Python绘制分布(折线)图crisis
⽤Python 绘制分布(折线)图,使⽤的是 plot()函数。
⼀个简单的例⼦:
# encoding=utf-8
import matplotlib.pyplot as plt
kssfrom pylab import *  # ⽀持中⽂
# 'mentioned0cluster',
你好英文
names = ['mentioned1cluster','mentioned2cluster', 'mentioned3cluster', 'mentioned4cluster', 'mentioned5cluster', 'mentioned6cluster', 'mentioned7cluster', 'mentioned8cluster', 'mentioned9cluster', 'mentioned10cluster'] x = range(len(names))
latitude# y_0625 = [39266,56796,42996,24872,13849,8609,5331,1971,554,169,26]
y_0626_1=[4793,100,0,0,0,0,0,0,0,0]
# y_0626_2=[2622,203,0,0,0,0,0,0,0,0,0]
# plt.plot(x, y, 'ro-')
# plt.plot(x, y1, 'bo-')
# pl.xlim(-1, 11) # 限定横轴的范围
# pl.ylim(-1, 110) # 限定纵轴的范围
edward
plt.plot(x, y_0626_1, marker='o', mec='r', mfc='w', label='HighRating:MentionedClusterNum Distribution')
# plt.plot(x, y_0626_2, marker='o', mec='r', mfc='w', label='LowRating:MentionedClusterNum Distribution')
repaired
# plt.plot(x, y1, marker='*', ms=10, label=u'y=x^3曲线图')
plt.legend()  # 让图例⽣效
plt.margins(0)
plt.subplots_adjust(bottom=0.15)
# plt.xlabel(u"time(s)邻居")  # X轴标签
plt.xlabel("clusters")
芝麻街英语好吗音乐之声主题曲plt.ylabel("number of reviews")  # Y轴标签
plt.title("A simple plot")  # 标题
西点培训学校自学英语的方法plt.show()
结果:

本文发布于:2023-06-25 06:08:29,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/1034273.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:学校   限定   范围   自学
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图