改变stat_qq中的线宽(用ggplot,in r) [英] changing line width in stat_qq (with ggplot, in r)
问题描述
我使用ggplot和stat_qq来绘制几个样本。
我想知道如何更改图表中线条的宽度没有运气: - (
以下是我的代码的相关部分:
ggplot(data = df,aes(sample = obser,color = sample))+
stat_qq(dist = qunif)+
scale_color_manual(values = c(samp_a (break = x_ax)+
scale_y_continuous(breaks = y_ax)+
theme(axis.text.x = element_text(angle = 90,hjust = 1,size = 10))+
theme(panel.background = element_rect(fill ='white',color ='gray'))+
主题(panel.grid.major = element_line(color =lightgrey,size = 0.5),panel.grid.minor = element_blank())
我的当前情节如下所示:
任何想法如何我尝试在ggplot中将大小添加到aes中,但没有运气,并且无法弄清楚有关stat_qq映射的解释:
http://docs.ggplot2.org/0.9.3/stat_qq.html
谢谢!!!
您错误地认为您正在处理线条。你有很多点并且想要改变点的大小。这里有一个简单的例子:
$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ g $ p $ frame(y),aes(sample = y))+ stat_qq(size = 1)
如果你想要线条,你可以使用这个:
code> ggplot(data.frame(y),aes(sample = y))+ stat_qq(geom =line,size = 0.5)
最小线宽小于最小点大小。
I am using ggplot with stat_qq to plot several samples.
I am trying to figure out how to change the width of the lines in the chart with no luck :-(
Here is (the relevant part of) my code:
ggplot(data=df,aes(sample=obser, colour = sample)) +
stat_qq(dist=qunif) +
scale_color_manual(values = c("samp_a" = "darkturquoise", "samp_b" = "hotpink", "samp_c" = "darkgrey")) +
scale_x_continuous(breaks=x_ax) +
scale_y_continuous(breaks=y_ax) +
theme(axis.text.x = element_text(angle = 90, hjust = 1,size = 10)) +
theme(panel.background = element_rect(fill='white', colour='grey')) +
theme(panel.grid.major = element_line(colour="lightgrey", size=0.5), panel.grid.minor = element_blank())
My current plot looks like this:
Any idea how to do it? I tried adding size to aes in ggplot with no luck and could not figure out the explanation about mapping for stat_qq:
http://docs.ggplot2.org/0.9.3/stat_qq.html
Thanks!!!
You are mistaken in the belief that you are dealing with lines. You have many points and want to change the point size. Here is a simple example:
y <- rt(200, df = 5)
ggplot(data.frame(y), aes(sample=y)) +stat_qq(size=1)
There is a minimum possible point size.
If you want lines, you can use this:
ggplot(data.frame(y), aes(sample=y)) +stat_qq(geom="line", size=0.5)
The minimum line size is smaller than the minimum point size.
这篇关于改变stat_qq中的线宽(用ggplot,in r)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!