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
> On Jul 18, 2018, at 1:55 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote: > > 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.Monthly contour plots in a 3x4 layout or put tiny histograms of monthly rainfall atop a tilted map of your locations. See section 13.5.1 in Sarkar's "Lattice".> Regards, > > Rich > > ______________________________________________ > R-help at 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.David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law
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 at r-project.org] On Behalf Of Rich Shepard Sent: Thursday, 19 July 2018 06:55 To: r-help at 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 at 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.
On Thu, 19 Jul 2018, Duncan Mackay wrote:> Try something like this... Duncan, That's impressive and well beyond anything I've done in the past. I'll study it to fully understand it and make it work for me.> I have put over 60 panels on an A4 page. > Space is a premium - you can reduce the right margin similar to the top see > ?trellis.par.get()On the smaller letter size page I may need to create two sets of plots if each panel is too small. Thank you for the valuable lesson. Best regards, Rich
> On Jul 18, 2018, at 1:55 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote: > > I have daily precipitation data for 58 locations from 2005-01-01 through > 2018-06-18.So roughly 5000 observations of latitiude, longitude, elevation(?), and amount. Maybe something dynamic like Hans Rosling does: https://towardsdatascience.com/how-to-build-animated-charts-like-hans-rosling-doing-it-all-in-r-570efc6ba382 possibly smoothing temporally. Googling `Hans Rosling R' and 'Dynamic Graphics in R' should get you some other hits including the Graphics Task View. HTH, Chuck
On Thu, 19 Jul 2018, Berry, Charles wrote:> So roughly 5000 observations of latitiude, longitude, elevation(?), and > amount. > > Maybe something dynamic like Hans Rosling does: > > https://towardsdatascience.com/how-to-build-animated-charts-like-hans-rosling-doing-it-all-in-r-570efc6ba382 > > possibly smoothing temporally. > > Googling `Hans Rosling R' and 'Dynamic Graphics in R' should get you some > other hits including the Graphics Task View.Chuck, Thanks for the suggestion. I'll read the web page and look at the other references you recommend. Regards, Rich
Hello, In addition to Duncan Mackay's excellent suggestion, I would recommend Bert Gunter's "stripless" package, for high-density Trellis-type conditioning plots. See the vignette for examples, and try out the code for "earthquake" and "barley" plots from the reference manual. https://CRAN.R-project.org/package=stripless https://cran.r-project.org/web/packages/stripless/vignettes/stripless_vignette.html Sincerely, W. Michels, Ph.D. On Thu, Jul 19, 2018 at 6:37 AM, Duncan Mackay <dulcalma at bigpond.com> wrote:> 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 at r-project.org] On Behalf Of Rich Shepard > Sent: Thursday, 19 July 2018 06:55 > To: r-help at 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 at 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. > > ______________________________________________ > R-help at 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.
On Fri, 20 Jul 2018, Duncan Mackay wrote:> If you have to make several plots you can subset your dataDuncan, That's what I thought I should do.> xyplot(... data = subset(x, condition), ...) > or > XYn <- xyplot(... data = x[row1:row2, ], ...) > in a loop > > have a look a ? print.trellis > > if you want to put several on a page > > if you need strips on left and top see > ?latticeExtra:::useOuterStripsThanks again, Rich