Skip to content

Instantly share code, notes, and snippets.

salim-b / export_plotly2SVG.R
Last active Dec 19, 2019
R function to export Plotly graphs as static SVG (and optionally PDF and PNG) images.
View export_plotly2SVG.R
# Remarks:
# The export is done using the automated testing framework [Selenium](https://
# which results in opening a browser window
# (Google Chrome) that might has to be closed by hand. Other than Plotly's
# own `export()` function this one also allows to set the `width` and `height`
# of the exported plot (in the former it's hardcoded to 800x600 pixels). If
# `incl_PDF_copy`/`incl_PNG_copy` is set to `TRUE`, the exported SVG additionally
# gets converted to a PDF/PNG using the R package [`rsvg`](
# jeroen/rsvg/tree/40576ac326621b40224db344b09158f4ff717433) which relies on

Keybase proof

I hereby claim:

  • I am salim-b on github.
  • I am salimb ( on keybase.
  • I have a public key ASAYNoQhxSE-AVpqORXXz3QMWLSlXBYZyI2epM6417mrIgo

To claim this, I am signing this object: