rgl.postscript:保存的文件不改变文本大小
从@DWin和@Ben Bolker,我们可以更改R中的scatter3d函数以绘制“更漂亮”的图(http://stackoverflow.com/questions/8204972/carscatter3d-in-r-labeling-axis-better),但是,保存情节比较棘手。 rgl.snapshot
将图像保存为 png,但要保存高分辨率图像 (PDF),必须使用 rgl.postscript
。使用 rgl.postscript 不会按照指定的字体/文本大小/轴大小保存图像(我编辑了 scatter3d 函数以增加文本/轴大小)。 rgl.snapshot
可以正常工作,那么为什么 rgl.postscript 不能呢?有谁知道另一种保存方法,或者有没有办法用更大的文本/轴等保存绘图?
From @DWin and @Ben Bolker, we can change the scatter3d function in R to plot "prettier" (http://stackoverflow.com/questions/8204972/carscatter3d-in-r-labeling-axis-better), however, saving the plot is a trickier. rgl.snapshot
saves the image as a png but to save a high resolution image (PDF) rgl.postscript
must be used. Using rgl.postscript
will not save the image with font/text size/axis sizes as specified (I edited the scatter3d
function to increase text/axis sizes). rgl.snapshot
works as it should so why doesn't rgl.postscript
? Does anyone know an alternative saving method or is there a way to save the plot with larger text/axis etc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个简单的例子对我来说适用于比 CRAN 更新版本的 rgl(CRAN 有 0.92.798,r-forge 现在有 0.92.836,这是 0.92.829)。看起来版本是按 SVN 修订版编号的,所以这是上面评论中提到的更新之后的一个版本...
但是,一个很大的警告是,生成的 PS、PDF、文件等是有点古怪。边界框有点奇怪,尽管我可以手动进行文本编辑。
ps2pdf
和ps2png
破坏了它..epstopdf
似乎有效(这些都是 Linux 机器上可用的工具,不知道对于其他操作系统)。原则上,rgl.postscript() 允许您导出为 PDF,但它可能会很奇怪……StackOverflow 无法识别该文件为有效的上传格式。A simple example works for me with the a more recent version of
rgl
than the CRAN one (CRAN has 0.92.798, r-forge now has 0.92.836, this is with 0.92.829). It looks like versions are numbered by SVN revision, so this is one version after the update mentioned in the comments above ...However, a big warning is that the resulting PS, PDF, files etc. are a bit wonky. The bounding boxes are a little odd, although I could text-edit that manually.
ps2pdf
andps2png
mangled it ..epstopdf
seems to have worked (these are all tools that are available on Linux boxes, don't know about for other OS). In principlergl.postscript()
allows you to export as PDF, but it might be weird PDF ... StackOverflow doesn't recognize the file as being in a valid upload format.