作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何才能绘制出比另一条线更粗的线。我尝试使用 geom_line(size=X) ,但这会增加两条线的粗细。假设我想增加第一列的厚度,如何才能实现这一点?
a <- (cbind(rnorm(100),rnorm(100))) #nav[,1:10]
sa <- stack(as.data.frame(a))
sa$x <- rep(seq_len(nrow(a)), ncol(a))
require("ggplot2")
p<-qplot(x, values, data = sa, group = ind, colour = ind, geom = "line")
p + theme(legend.position = "none")+ylab("Millions")+xlab("Age")+
geom_line( size = 1.5)
最佳答案
您需要将线条粗细映射到变量:
p + geom_line(aes(size = ind))
要控制厚度,请使用scale_size_manual()
:
p + geom_line(aes(size = ind)) +
scale_size_manual(values = c(0.1, 1))
关于r - ggplot特定粗线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17996410/
在这个 jsfiddle 中有一行的 lineWidth 为 1。 http://jsfiddle.net/mailrox/9bMPD/350/ 例如: ctx.lineWidth = 1; 但是画在
我是一名优秀的程序员,十分优秀!