Avi Gross
2021-Nov-11 01:53 UTC
[R] ggplot2: multiple box plots, different tibbles/dataframes
Rich, I think many here may not quite have enough info to help you. But the subject of multiple plots has come up. There are a slew of ways, especially in the ggplot paradigm, to make multiple smaller plots into a larger display showing them in some number of rows and columns, or other ways. Some methods use facet_wrap() or facet_grid() type functionality that let you plot multiple subdivisions of the data independently. These though generally have to be in some way related. Yet others let you make many independent graphs and save them and later recombine them in packages like cowplot. So, although it may also be possible to do whatever it is you want within a single plot, it may also make sense to do it as loosely described above. -----Original Message----- From: R-help <r-help-bounces at r-project.org> On Behalf Of Rich Shepard Sent: Wednesday, November 10, 2021 4:53 PM To: R-help <r-help at r-project.org> Subject: Re: [R] ggplot2: multiple box plots, different tibbles/dataframes On Wed, 10 Nov 2021, Bert Gunter wrote:> As always, online search (on "ggplot2 help") seemed to bring up useful > resources. I suggest you look here (suggested tutorials and resources > are farther down the page): https://ggplot2.tidyverse.org/Bert, My web search was for multiple boxplots and I didn't see what I wanted. I'll continue reading the ggplot2 third edition and figure it out. 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.
Rich Shepard
2021-Nov-11 13:50 UTC
[R] ggplot2: multiple box plots, different tibbles/dataframes
On Wed, 10 Nov 2021, Avi Gross via R-help wrote:> I think many here may not quite have enough info to help you.Avi, Actually, you've reflected my thinking.> But the subject of multiple plots has come up. There are a slew of ways, > especially in the ggplot paradigm, to make multiple smaller plots into a > larger display showing them in some number of rows and columns, or other > ways. Some methods use facet_wrap() or facet_grid() type functionality that > let you plot multiple subdivisions of the data independently. These though > generally have to be in some way related.My experience with facets (which I belive are like latice's conditioned trellis plots has each plot in a separate frame in a row, column, or matrix.) That won't communicate what I want viewers to see as well as would having all in a single frame. My data represent hydrologic and geochemical conditions at four locations along the mainstem of a river. While the period of record for each monitoring gauge is different, I want to illustrate how highly variable conditions are at each location. The major factor of interest is discharge, the volume of water passing a river cross section at the gauge location in cubic feet per second. I have created boxplots for each site representing the distribution of discharge for the entire data set and I'd like to place each of the four horizontal boxplots stacked vertically with the southern-most at the bottom and the northern-most at the top (the river flows north).> Yet others let you make many independent graphs and save them and later > recombine them in packages like cowplot.I discovered cowplot yesterday but haven't yet read the PDF or vignette.> So, although it may also be possible to do whatever it is you want within a > single plot, it may also make sense to do it as loosely described above.While I certainly may be wrong, I believe that seeing all four boxplots in the same frame makes the differences in distribution most clear. Thanks, Rich