Plot ridges density plots for numeric matrix input
Arguments
- x
matrix
with numeric values, or alist
ofnumeric
vectors. In either case the data is converted to long-tall format before plotting.- xScale
character
string indicating whether to transform the x-axis values:"none"
: no transformation"-log10"
: values are transformed withlog10(x)
and x-axis labels are adjusted accordingly."log10"
: values are transformed withlog10(1 + x)
except that negative values are transformed with-log10(1 - x)
. The x-axis labels are plotted to account for thelog10(1 + x)
offset.
- xlab, ylab
character
strings optionally used as x-axis and y-axis labels.- title, subtitle, caption
character
string values optionally passed to the relevant downstreamggplot2
functions.- xlim
passed to
ggplot2::xlim()
to define the x-axis range.- color_sub
character
vector named bycolnames(x)
, or whenx
is alist
,names(color_sub)
should containnames(x)
, used to define specific colors for each ridge plot.- rel_min_height
numeric
values passed toggridges::geom_density_ridges2()
- bandwidth
numeric
value used to define the bandwidth density whenshare_bandwidth=TRUE
which is default. The bandwidth affects the level of detail presented in each ridgeline, and when shared across ridgelinesshare_bandwidth=TRUE
then each ridgeline will use the same consistent level of detail. In this case, it is passed toggridges::geom_density_ridges2()
. Note whenbandwidth=NULL
a default value is derived from the range of data to be plotted.- adjust
numeric
used to adjust the default bandwidth only whenbandwidth=NULL
. It is intended as a convenient method to adjust the level of detail.- scale
numeric
passed directly toggridges::geom_density_ridges2()
.logical
indicating whether to supplyggridges::geom_density_ridges2()
a specificbandwidth
to use for all ridgelines. Whenshare_bandwidth=FALSE
then each ridgeline is presented using the default bandwidth inggridges::geom_density_ridges2()
.- ...
additional arguments are ignored.
Details
This function is a convenient wrapper for ggridges::geom_density_ridges2()
,
intended to be analogous to plotPolygonDensity()
which differs
by plotting each item in a separate plot panel using base graphics.
This function plots each item as a ridgeline plot in the same
plot window using ggplot2::ggplot()
.
See also
Other jam plot functions:
adjustAxisLabelMargins()
,
coordPresets()
,
decideMfrow()
,
drawLabels()
,
getPlotAspect()
,
groupedAxis()
,
imageByColors()
,
imageDefault()
,
minorLogTicksAxis()
,
nullPlot()
,
plotPolygonDensity()
,
plotSmoothScatter()
,
shadowText()
,
shadowText_options()
,
showColors()
,
sqrtAxis()
,
usrBox()