output
slot.
renderPlot(expr, width = "auto", height = "auto", res = 72, ..., env = parent.frame(), quoted = FALSE, execOnResize = FALSE, outputArgs = list())
'auto'
to use the offsetWidth
/offsetHeight
of 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
width
and height
.png
. Note that this affects the resolution of PNG
rendering in R; it won't change the actual ppi of the browser.png
.
These can be used to set the width, height, background color, etc.expr
.expr
a 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 TRUE
.plotOutput
when renderPlot
is used in an
interactive R Markdown document.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. See plotOutput
for more information about interactive plots.div
or img
and have
the CSS class name shiny-plot-output
.
plotOutput
. For more details on how the plots are
generated, and how to control the output, see plotPNG
.