Renders a reactive plot that is suitable for assigning to an
An expression that generates a plot.
- width, height
Height and width can be specified in three ways:
"auto", the default, uses the size specified by
offsetWidth/`offsetHeight`` of the HTML element bound to this plot.)
An integer, defining the width/height in pixels.
A function that returns the width/height in pixels (or
"auto"). The function is executed in a reactive context so that you can refer to reactive values and expression to make the width/height reactive.
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
plotPNG(). 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
plotPNG(). These can be used to set the width, height, background color, etc.
Alternate text for the HTML
<img>tag if it cannot be displayed or viewed (i.e., the user uses a screen reader). In addition to a character string, the value may be a reactive expression (or a function referencing reactive values) that returns a character string. If the value is
NA(the default), then
ggplot2::get_alt_text()is used to extract alt text from ggplot objects; for other plots,
NAresults in alt text of "Plot object".
""is not recommended because those should be limited to decorative images.
The parent environment for the reactive expression. By default, this is the calling environment, the same as when defining an ordinary non-reactive expression. If
expris a quosure and
If it is
TRUE, then the
quote()ed value of
exprwill be used when
expris evaluated. If
expris a quosure and you would like to use its expression as a value for
expr, then you must set
FALSE(the default), then when a plot is resized, Shiny will replay the plot drawing commands with
grDevices::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.
For the corresponding client-side output function, and example
plotOutput(). For more details on how the plots are
generated, and how to control the output, see
renderCachedPlot() offers a way to cache generated plots to
expedite the rendering of identical plots.