Windows 下 R 图形中的抗锯齿(根据 Mac)
有没有办法从 Windows 版本的 R 中绘制抗锯齿图形?正如您从下面的两个版本中看到的,Mac 版本的 R 打印图形抗锯齿....
....虽然 Windows 版本对文本进行抗锯齿处理,但它不会对实际图形进行抗锯齿处理,从立管点和网格可以看出:
顺便说一句,这是代码:
library(scatterplot3d)
attach(mtcars)
s3d <-scatterplot3d(wt,disp,mpg, pch=16, highlight.3d=TRUE,
type="h", main="3D Scatterplot")
fit <- lm(mpg ~ wt+disp)
s3d$plane3d(fit)
我需要尽可能高的质量来发布网页。我正在运行 Windows 7 并从 RBloomberg 提取数据,该数据仅在 Windows 下运行。
is there a way to plot anti-aliased graphics from the Windows version of R? As you can see from the two versions below the Mac version of R prints graphics anti aliased....
....whereas while the Windows version anti-aliases text, it does not anti-alias the actual graphic, as can be seen from the riser points, and the grid:
Here is the code by the way:
library(scatterplot3d)
attach(mtcars)
s3d <-scatterplot3d(wt,disp,mpg, pch=16, highlight.3d=TRUE,
type="h", main="3D Scatterplot")
fit <- lm(mpg ~ wt+disp)
s3d$plane3d(fit)
I need the highest quality possible, for web page publication. I am running Windows 7 and pulling data from RBloomberg, which only works under Windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能取决于每个平台上渲染引擎的细节,而这些细节可能很难修改。我的建议(未经测试,因为缺乏时间和访问 Windows):
cairoDevice
包并使用Cairo_png()
。根据文档:convert
)或其他工具来获取所需的抗锯齿版本。This is likely to depend on details of the rendering engine on each platform, which could be hard to modify. My suggestions (untested, for lack of time and access to Windows):
cairoDevice
package and useCairo_png()
. According to the documentation:convert
) or some other tool to get the anti-aliased version you need.将 Cairo 与
png
设备一起使用时不再需要安装cairoDevice
。现在,您可以在打开设备时指定type='cairo'
。比较以下内容:我运行的是 Win 8.1 和 64 位 R 3.2.2。
Installing
cairoDevice
is no longer necessary for using Cairo withpng
devices. You can now specifytype='cairo'
when opening the device. Compare the following:I'm running Win 8.1, and 64-bit R 3.2.2.
使用矢量设备,例如 pdf。首先确保您具有该功能,因此毫不奇怪,要检查的功能是功能。如果您确实有 pdf,那么只需执行以下操作:
Web 输出的替代方案可能是 png() 图形设备。尽管它是一种光栅格式,但它在紧凑性和网络浏览器兼容性方面获得了很高的评价。
Use a vector device such as pdf. First make sure you have that capability and so not surprisingly the
capabilities
function is what to check. If you do have pdf then just do this:An alternative for web output might be the png() graphics device. It gets high marks for compactness and web browser compatibility although it is a raster format.