简体   繁体   中英

Export 300dpi tiff of plotly plot in R

Is there a way to export a 300dpi tiff of a plotly plot? I have a sunburst chart I'm trying to export but I can't find a good way to get the resolution I need.

You will need to install orca. Please find the installation instructions here .

Once it is installed you can use plotly's orca() function. The plotly book gives the following information regarding exports specified in inches (DPI):

It's worth noting that the height and width of a static image must be specified in pixels, which is intuitive for most file formats (png, jpeg, svg, etc) but when exporting to pdf, you might want to specify the size in inches. If you multiply the DPI of your machine's display by the number of inches you want, you'll get the desired result.

Accordingly for 300 DPI you will need something like:

orca(plot_ly(), width = 8 * 300, height = 11 * 300)

Also, you might want to see this related article.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM