r - Wordcloud2 R:跨 rstudio、savewidget 和 webshot 保存相同的图像
问题描述
我想将 Rstudio 中的 wordcloud2 视图保存为 html 和 PNG 文件。
我正在关注这篇文章中的答案,包括 wordcloud2、htmlwidgets 和 webshot 库:如何在 R 中保存 wordcloud
library(wordcloud2)
library(htmlwidgets)
library(webshot)
set.seed(1)
plot <- wordcloud2(word, freq, size = 1, minRotation = 0,
maxRotation = 0, shuffle = FALSE,
color = rainbow(nrow(word))
print(plot)
saveWidget(plot, "test.html", selfcontained = FALSE)
webshot("test.html", "test.png", delay=15)
我面临的问题是,每个可视化在单词的位置方面都略有不同。有没有办法在保存步骤中避免这种随机性?
解决方案
推荐阅读
- python - matplotlib 绘图在谷歌 colab 中不起作用
- ios - ITMS-90626:无效的 Siri 支持 - 自定义意图的本地化标题:找不到区域设置的“配置”:de_DE
- ios - iOS Calendar.ordinality(of:in:for:) 时代月份的错误结果
- kubernetes - 如何访问 3rd-party 自定义资源定义?
- python - Python OpenCV 抛出 cv::OutOfMemoryError
- flutter - 在底部导航栏中更改页面时强制 Flutter 不丢失数据
- spring - 在运行时 Spring Boot 上更改对静态 Web 资源的访问
- python - 无法使用 css 选择器在 python 中获取数据
- python - Python curse 显示时钟示例刷新数据
- r - 根据相对于治疗日期的日期查找事件