On 03/06/2014 12:44 AM, Bernard North wrote:
Dear R list,
I am plotting a discrete valued number on the y axis against a continuous
variable on the x axis.
To allow sample size to be viewed for the discrete groups I am using vertical
jitter.
So my code is along the lines of
y<-rpois(500,2)
x<-rnorm(500,y,1)
plot(x,jitter(y))
It has not been suggested that a more informative view of the sample size might
be if a histogram could be inserted into the plot (instead of the jittered rows
of points) for the values at each y-value
Many thanks if anyone can think of a way to do this
Hi Bernard,
You can use the subplot function in the TeachingDemos package to do
things like this.
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.