View source: R/plots-utility-dimensions.R
getSizePlot | R Documentation |
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
)
width |
Numeric, width of the plot in pixels, 800 by default. |
height |
Numeric, height of the plot in pixels, 500 by default. |
gg |
|
nrow |
single-length integer specifying the
number of facet rows in the plot. (default = 1)
Overwritten if |
ncol |
single-length integer specifying the
number of facet columns in the plot. (default = 1)
Overwritten if |
title |
String with title for the plot. |
subtitle |
String with subtitle. |
caption |
String with caption. |
xLab |
String with label for |
facet |
Logical, if TRUE the plot contains facets. |
includeLegend |
Logical, if TRUE (by default) a legend is available in the plot. |
legendPosition |
String with position of the legend, among: 'top'/'left'/'bottom'/'right', 'right' by default. |
y |
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. |
Numeric vector with width ('width') and height ('height') of the plot in pixels.
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.