Suggestions for scatter plot of many data

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Suggestions for scatter plot of many data

Rich Shepard
   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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for scatter plot of many data

David Winsemius

> On Jul 18, 2018, at 1:55 PM, Rich Shepard <[hidden email]> 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
>
> ______________________________________________
> [hidden email] 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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for scatter plot of many data

Duncan Mackay-4
In reply to this post by Rich Shepard
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:[hidden email]] On Behalf Of Rich Shepard
Sent: Thursday, 19 July 2018 06:55
To: [hidden email]
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

______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for scatter plot of many data

Rich Shepard
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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for scatter plot of many data

Berry, Charles
In reply to this post by Rich Shepard


> On Jul 18, 2018, at 1:55 PM, Rich Shepard <[hidden email]> 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
______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for scatter plot of many data

Rich Shepard
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

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for scatter plot of many data

R help mailing list-2
In reply to this post by Duncan Mackay-4
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 <[hidden email]> 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:[hidden email]] On Behalf Of Rich Shepard
> Sent: Thursday, 19 July 2018 06:55
> To: [hidden email]
> 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
>
> ______________________________________________
> [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for scatter plot of many data

Rich Shepard
On Thu, 19 Jul 2018, William Michels wrote:

> 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

William,

   Very much appreciated. I'll certainly look closely at the package.

Best regards,

Rich

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Suggestions for scatter plot of many data

Rich Shepard
In reply to this post by Rich Shepard
On Fri, 20 Jul 2018, Duncan Mackay wrote:

> If you have to make several plots you can subset your data

Duncan,

   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:::useOuterStrips

Thanks again,

Rich

______________________________________________
[hidden email] 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.