【发布时间】:2019-01-04 16:32:25
【问题描述】:
我的绘图选项卡不起作用 - 所以我试图在查看器选项卡中显示 ggplot 的输出。
这已为打印 HTML 表格完成:Force rstudio to use browser instead of viewer。这可以用于地块吗?
library(ggplot2)
gg.plot <- ggplot(mtcars, aes(mpg, wt)) + geom_point()
有没有办法打印到查看器?
【问题讨论】:
-
如果绘图窗格不起作用,您可以使用
library(ggplot2) data(iris) x11() ggplot(data = iris, aes(Petal.Length)) + geom_histogram()中的 x11() 函数将绘图定向到外部窗口 -
运行那段代码时出现错误
Error: unexpected symbol in "x11() ggplot。我可以打印到 PDF,但这不是一个理想的解决方案。 -
x11()和ggplot(...)是独立的命令,需要在不同的行上运行。