[R] Suggestions for scatter plot of many data

Duncan Mackay du|c@|m@ @end|ng |rom b|gpond@com
Thu Jul 19 15:37:56 CEST 2018


Hi Rich

Try something like this

set.seed(1)
xy <- 
data.frame(x = rnorm(108),
           y = rnorm(108),
           gp = rep(1:9, ea = 12))


xyplot(y~x|gp, xy,
       as.table = TRUE,
       strip = F,
       strip.left = F,
       layout = c(3,3),
       par.settings= list(layout.heights = list(main = 0,
                                          axis.top = 0.3),
                          plot.symbol = list(pch = ".",
			                     col = "#000000",
			                     cex = 3)
	           ),
       scales = list(x = list(alternating = FALSE,
                              relation    = "same"),
                     y = list(alternating = FALSE,
                              relation    = "same")
                 ),
       panel = function(x,y, ...){

                 panel.xyplot(x,y, ...)
                 panel.text(-1, 2, paste("Group", 1:9)[which.packet()])

               }
)

I have put over 60 panels on an A4 page.
You may have to put an if statement for the group names if they overlap
data.
Space is a premium - you can reduce the right margin similar to the top see
?trellis.par.get()

Regards

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2350
 



-----Original Message-----
From: R-help [mailto:r-help-bounces using r-project.org] On Behalf Of Rich Shepard
Sent: Thursday, 19 July 2018 06:55
To: r-help using r-project.org
Subject: [R] Suggestions for scatter plot of many data

   I have daily precipitation data for 58 locations from 2005-01-01 through
2018-06-18. Among other plots and analyses I want to apply lattice's
xyplot() to illustrate the abundance and patterns of the data.

   I've used a vector of colors (and a key) when there were only eight
weather stations and the date range was three months. This was very
effective in communicating the amounts and patterns.

   I'm asking for ideas on how to best present these data in a scatter plot.

Regards,

Rich

______________________________________________
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
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