rgl_static_plots_Description | R Documentation |
Embedding the Static Plots
To embed a static plot in an R Markdown document, first execute
rgl::setupKnitr()
to prepare the document for embedding the snapshot
of the Open GL window. Then execute the plot command as you normally would
to create an Open GL window (i.e. without specifying fname
, and by
requesting only one idx
). In the options for the chunk in which the
plot command is executed, set rgl=TRUE, format="png"
. You can also
control the image dimensions here e.g. fig.height=3.8, fig.width=5
.
When the R Markdown document is knitted, the static plots should be
displayed below the chunk in which the plot command was executed. See the
vignette for an example.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.