繁体   English   中英

如何在R中绘制连续线?

[英]How to plot continuous lines in R?

如何在需要连续样品线的情况下绘制这种数据? 样品A,B和C需要三条线; 值在Y轴上,rec在X轴上。

mydata<- structure(list(samples = structure(c(1L, 2L, 3L, 1L, 2L, 3L), .Label = c("A", 
"B", "c"), class = "factor"), value = c(1, 8, 7, 2, 5, 9), rec = c(7158, 
6975, 6573, 1122, 2235, 229)), .Names = c("samples", "value", 
"rec"), class = "data.frame", row.names = c(NA, -6L))

你可以使用ggplot2来做到这一点

library(ggplot2)
ggplot(mydata, aes(x = rec, y = value)) + geom_line(aes(group = samples))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM