ggpreview | R Documentation |
Saves the plot in a tmp location and loads it as an image.
ggpreview(x, w = 5, h = 5, dpi = 150, units = "in")
x |
plot to visualize |
w |
width in inches |
h |
height in inches |
dpi |
resolution |
units |
character string specifying the units of the dimensions. By default in, inches, but it can also be px, cm, or mm. |
Show plot image in Viewer pane
## Not run: library(ggplot2) df <- data.frame(x = 1:10, y = 1:10) tmp_plt <- ggplot2::ggplot(df, ggplot2::aes(x = x, y = y)) + ggplot2::geom_point() ggpreview(x = tmp_plt, w = 9, h = 4, units = "in") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.