博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
R之折线图
阅读量:4112 次
发布时间:2019-05-25

本文共 610 字,大约阅读时间需要 2 分钟。

需求:

用R语言画折线图

实现:

xiao <- read.table("d:/final.txt",header=T,sep=",")data<-xiao[order(-xiao[,2]),]Precision<-data[,1]Recall<-data[,2]plot(Recall,Precision,type="o",main="PR图",col="blue",frame.plot=TRUE)

对应的数据文件参见附件

显示图如下:

 
参数说明:

plot(x, y, type,main,col,frame.plot...)

x:x的数据列

y:y的数据列

type包括如下:

"p" for points,

 

"l" for lines,

 

"b" for both,

 

"c" for the lines part alone of "b",

 

"o" for both ‘overplotted’,

 

"h" for ‘histogram’ like (or ‘high-density’) vertical lines,

 

"s" for stair steps,

 

"S" for other steps, see ‘Details’ below,

 

"n" for no plotting.

main:an overall title for the plot: see title.

更多参见

help(plot)

转载地址:http://olqsi.baihongyu.com/

你可能感兴趣的文章
JavaSE_day12 集合
查看>>
JavaSE_day14 集合中的Map集合_键值映射关系
查看>>
Day_15JavaSE 异常
查看>>
异常 Java学习Day_15
查看>>
JavaSE_day_03 方法
查看>>
day-03JavaSE_循环
查看>>
Mysql初始化的命令
查看>>
day_21_0817_Mysql
查看>>
day-22 mysql_SQL 结构化查询语言
查看>>
MySQL关键字的些许问题
查看>>
浅谈HTML
查看>>
css基础
查看>>
HTML&CSS进阶
查看>>
Servlet进阶和JSP基础
查看>>
servlet中的cookie和session
查看>>
过滤器及JSP九大隐式对象
查看>>
软件(项目)的分层
查看>>
菜单树
查看>>
MySQL-分布式架构-MyCAT
查看>>
设计模式六大原则(6):开闭原则
查看>>