This function set sensitive defaults dimensions for a plot in the package. This includes:
setting a default width for a figure to fit in a standard clinical data review report
increasing the figure height:
for facetted plot, ensuring that each facet is relatively squared
if a caption, subtitle, title, title for the x-axis are specified
if a legend is set at the bottom or the top of the plot
increasing the figure width if a legend is set at the left or the right of the plot
getSizePlot(
width = NULL,
height = NULL,
gg = NULL,
nrow = 1L,
ncol = 1L,
title = NULL,
subtitle = NULL,
caption = NULL,
xLab = NULL,
facet = FALSE,
includeLegend = TRUE,
legendPosition = "right",
y = NULL
)
Numeric vector with width ('width') and height ('height') of the plot in pixels.
Numeric, width of the plot in pixels, 800 by default.
Numeric, height of the plot in pixels, 500 by default.
single-length integer specifying the
number of facet rows in the plot. (default = 1)
Overwritten if gg
is specified.
single-length integer specifying the
number of facet columns in the plot. (default = 1)
Overwritten if gg
is specified.
String with title for the plot.
String with subtitle.
The subtitle is included at the top left of the plot,
below the title.
String with caption.
The caption is included at the bottom right of the plot.
Please note that this might overlap with
vertical or rotated x-axis labels.
String with label for xVar
.
Logical, if TRUE the plot contains facets.
Logical, if TRUE (by default) a legend is available in the plot.
String with position of the legend, among: 'top'/'left'/'bottom'/'right', 'right' by default.
Character vector or factor with elements in the y-axis, or list of such vectors. If a list is provided, the maximum height obtained across the different list elements is used.
Laure Cougnaud