繁体   English   中英

如何从高质量的绘图中将绘图导出为静态图像?

[英]How to export a plot as static Image from plotly with high quality?

对于可视化部分,我使用 ggplotly,然后将我的 markdown 文件编入 HTML。 接下来,当我想从 plotly 输出中下载静态图像时,PNG 文件的质量非常低。 所以,我想知道是否有办法提高可下载静态图像的质量?

在此处输入图像描述

您可以在创建 Plotly 对象时修改模式栏。 (您也可以稍后添加更改。)您可以在此处查看有关模式栏的更多选项。

例如:

library(plotly)
data(gapminder, package = "gapminder")

plot_ly(data = gapminder, x = ~continent, y = ~lifeExp, 
        type = "bar") %>% 
  config(
    toImageButtonOptions = list(
      format = "svg",
      filename = "myplot",
      width = 600,
      height = 700
    )
  )

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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