[R] ggplot2: multiple box plots, different tibbles/dataframes
w||||@mwdun|@p @end|ng |rom gm@||@com
Thu Nov 11 16:39:28 CET 2021
I googled for "ggplot2 boxplots by group" and the first hit was
which displays lots of variants along with the code to produce them. It
has links to ungrouped boxplots and shows how violin plots can better
display your data.
On Thu, Nov 11, 2021 at 5:50 AM Rich Shepard <rshepard using appl-ecosys.com>
> On Wed, 10 Nov 2021, Avi Gross via R-help wrote:
> > I think many here may not quite have enough info to help you.
> 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
> > let you plot multiple subdivisions of the data independently. These
> > 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.
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help