Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 在浏览器选项卡中更改plotly html打印标题_R_Plotly - Fatal编程技术网

R 在浏览器选项卡中更改plotly html打印标题

R 在浏览器选项卡中更改plotly html打印标题,r,plotly,R,Plotly,我使用plotly将数据保存为html小部件,并在浏览器中打开数据,因为我发现本机查看器速度非常慢 脱机绘图代码 通常,我在浏览器中同时打开了几个绘图,它们渲染得很好,但所有绘图在浏览器选项卡中都具有相同的标题,是否有方法更改此设置并将选项卡标题设置为自定义 有一篇文章类似于这个页面的链接:但我不太明白 您需要通过添加title参数为htmlwidgets::saveWidget中的选项卡指定标题 谢谢谁知道会这么简单:顺便说一句,除了orca之外,你知道有什么方法可以将绘图保存为pdf或eps

我使用plotly将数据保存为html小部件,并在浏览器中打开数据,因为我发现本机查看器速度非常慢

脱机绘图代码

通常,我在浏览器中同时打开了几个绘图,它们渲染得很好,但所有绘图在浏览器选项卡中都具有相同的标题,是否有方法更改此设置并将选项卡标题设置为自定义

有一篇文章类似于这个页面的链接:但我不太明白


您需要通过添加title参数为htmlwidgets::saveWidget中的选项卡指定标题


谢谢谁知道会这么简单:顺便说一句,除了orca之外,你知道有什么方法可以将绘图保存为pdf或eps文件吗?对不起,我不知道。如果你对它有疑问,也许最好问一个新问题。
library(plotly)
libraray(htmlwidgets)

offlinePlot <- function(pname, fname, browse = T){
 saveWidget(as_widget(x = pname), file = fname)
 if(browse){
 browseURL(fname)
 }
}

offlinePlot(pname = sampleplot, fname = sampleplot.html, browse = T)
library(plotly)

x <- c(1:100)
random_y <- rnorm(100, mean = 0)
data <- data.frame(x, random_y)

p <- plot_ly(data, x = ~x, y = ~random_y, type = 'scatter', mode = 'lines')


htmlwidgets::saveWidget(as_widget(p), "graph.html",title = "my title")