Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotly_IMAGE

Create a static image


Description

The images endpoint turns a plot (which may be given in multiple forms) into an image of the desired format.

Usage

plotly_IMAGE(
  x,
  width = 1000,
  height = 500,
  format = "png",
  scale = 1,
  out_file,
  ...
)

Arguments

x

either a plotly object or a list.

width

Image width in pixels

height

Image height in pixels

format

The desired image format 'png', 'jpeg', 'svg', 'pdf', 'eps', or 'webp'

scale

Both png and jpeg formats will be scaled beyond the specified width and height by this number.

out_file

A filename for writing the image to a file.

...

arguments passed onto httr::RETRY

Examples

## Not run: 
p <- plot_ly(x = 1:10)
Png <- plotly_IMAGE(p, out_file = "plotly-test-image.png")
Jpeg <- plotly_IMAGE(p, format = "jpeg", out_file = "plotly-test-image.jpeg")
Svg <- plotly_IMAGE(p, format = "svg",  out_file = "plotly-test-image.svg")
Pdf <- plotly_IMAGE(p, format = "pdf",  out_file = "plotly-test-image.pdf")

## End(Not run)

plotly

Create Interactive Web Graphics via 'plotly.js'

v4.10.0
MIT + file LICENSE
Authors
Carson Sievert [aut, cre] (<https://orcid.org/0000-0002-4958-2844>), Chris Parmer [aut], Toby Hocking [aut], Scott Chamberlain [aut], Karthik Ram [aut], Marianne Corvellec [aut] (<https://orcid.org/0000-0002-1994-3581>), Pedro Despouy [aut], Salim Brüggemann [ctb] (<https://orcid.org/0000-0002-5329-5987>), Plotly Technologies Inc. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.