首页 > 编程语言 > 详细

Python 和 R语言 中的折线图

时间:2020-01-10 21:02:19      阅读:85      评论:0      收藏:0      [点我收藏+]

1、用 R 的基础图形系统

 x <- c(21, 33, 42, 46, 60)
 y <- c(16, 20, 27, 41, 61)
 
plot(x, y, type=b‘)

技术分享图片

 

 

2 matplotlib 库

import matplotlib.pyplot as plt 

x = [21, 33, 42, 46, 60]
y = [16, 20, 27, 41, 61]

plt.plot(x, y, marker=o‘, ls=--‘, c=k)
plt.xlabel(x)
plt.ylabel(y)

plt.show()

技术分享图片

 

 

按语:

R 可以自动给出坐标轴标题。

Python 和 R语言 中的折线图

原文:https://www.cnblogs.com/shanger/p/12178039.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!