geom_jitter(aes(t, val), data = df, colour = I("red"))
> --
> You received this message because you are subscribed to the ggplot2
> mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
Hi:
In addition to Erik's answer, I prefer to rein in the jittering, something like the following:
# Your original code:
dfsumm <- data.frame(x=1:3, mean=c(4,5,7), sd=c(1,1,2))
ggplot(dfsumm, aes(x, mean))+
geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width = 0.5)+geom_point()
# I tightened the width of the error bars in the previous line.
# Generated more data to illustrate my point about tightening the jitter...
df <- data.frame(tt = rep(1:3, each = 40),
val = round(rnorm(120, m = rep(c(4, 5, 7), each = 40))))geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width = 0.5, size = 1) +
ggplot(dfsumm, aes(x, mean))+
geom_point(size = 3) +
geom_jitter(aes(tt, val), data = df, colour = I("red"),
position = position_jitter(width = 0.05))
I added the position argument to Erik's geom_jitter() suggestion to exert control over the extent of the jittering and played around with other arguments such as thickness of the error bars (size = 1) and size of the center points (size = 3 in geom_point()). This should give you some ideas how to customize your plot.
HTH,
Dennis
| Troy S <troysoc...@yahoo.com>
Sent by: ggp...@googlegroups.com 12/16/2010 02:23 PM |
|
--
You received this message because you are subscribed to the ggplot2 mailing
list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
This communication may contain privileged and/or confidential information. It is intended solely for the use of the addressee. If you are not the intended recipient, you are strictly prohibited from disclosing, copying, distributing or using any of this information. If you received this communication in error, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. This communication may contain nonpublic personal information about consumers subject to the restrictions of the Gramm-Leach-Bliley Act. You may not directly or indirectly reuse or redisclose such information for any purpose other than to provide the services for which you are receiving the information. 127 Public Square, Cleveland, OH 44114
| Erik Iverson <er...@ccbr.umn.edu>
Sent by: ggp...@googlegroups.com 12/16/2010 03:02 PM |
|