Renders a reactive plot that is suitable for assigning to an
renderPlot(expr, width = "auto", height = "auto", res = 72, ..., env = parent.frame(), quoted = FALSE, execOnResize = FALSE, outputArgs = list())
An expression that generates a plot.
- width, height
The width/height of the rendered plot, in pixels; or
'auto'to use the
offsetHeightof the HTML element that is bound to this plot. You can also pass in a function that returns the width/height in pixels or
'auto'; in the body of the function you may reference reactive values and functions. When rendering an inline plot, you must provide numeric values (in pixels) to both
Resolution of resulting plot, in pixels per inch. This value is passed to
png. Note that this affects the resolution of PNG rendering in R; it won't change the actual ppi of the browser.
Arguments to be passed through to
png. These can be used to set the width, height, background color, etc.
The environment in which to evaluate
expra quoted expression (with
quote())? This is useful if you want to save an expression in a variable.
FALSE(the default), then when a plot is resized, Shiny will replay the plot drawing commands with
replayPlot()instead of re-executing
expr. This can result in faster plot redrawing, but there may be rare cases where it is undesirable. If you encounter problems when resizing a plot, you can have Shiny re-execute the code on resize by setting this to
A list of arguments to be passed through to the implicit call to
renderPlotis used in an interactive R Markdown document.
The corresponding HTML output tag should be
img and have
the CSS class name
With ggplot2 graphics, the code in
renderPlot should return a ggplot
object; if instead the code prints the ggplot2 object with something like
print(p), then the coordinates for interactive graphics will not be
properly scaled to the data space.
plotOutput for more information about interactive plots.