[R] How to generate scatterplot - with a twist

Greg Snow Greg.Snow at imail.org
Fri Oct 1 23:09:21 CEST 2010


If it is important to have points rather than just create the grid, then you could do something using the my.symbols function in the TeachingDemos package.  One of the examples on the help page fills the plot with hexagons, the calculations for squares should be simpler.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of thernubblet
> Sent: Friday, October 01, 2010 9:41 AM
> To: r-help at r-project.org
> Subject: [R] How to generate scatterplot - with a twist
> 
> 
> Hi. I would like to make a scatterplot where all of the points are
> evenly
> spaced from each other - however, they are all the same size and occupy
> the
> entire graph. For example:
> 
> x = rep(c(1:10), 10)
> y = rep(c(10:1), each = 10)
> plot(x, y, pch = 0)
> 
> Gives me a scatter plot with 100 square points each evenly spaced
> between
> each other. But these points don't fill up the entire space and if I
> try to
> change the 'cex' value, the points on the edges get messed up. I was
> wondering if there was a way to fill up the entire space (all of the
> edges
> of the little squares are touching each other) and each individual
> square is
> the same size. Any help will be greatly appreciated!
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-
> generate-scatterplot-with-a-twist-tp2923805p2923805.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list