轴箭头的ggplot主题参数突然不起作用
我有一个自定义的GGPLOT主题,现在已经使用了一段时间了。本周,我在使用此主题进行图时开始遇到
错误我以前用过将轴线变成箭头的参数。我能够重现下面的错误,但是我很困惑为什么现在会发生这种错误。有人知道为什么会发生这种情况或可能为将轴线变为箭头的一些替代方案吗?
例如:
library(ggplot2)
dat <- mtcars
ggplot(data = dat) +
geom_point(aes(x = wt, y = mpg)) +
theme(axis.line = element_line(color = "black", arrow = arrow(length = unit(0.3, "lines"), type = "closed")))
编辑:
加载图形库(library(Graphics)
)临时修复了问题。但是,编织降价文件会产生与上面相同的错误。似乎我的示例不是重现错误,但是即使在重新安装rstudio并更新所有软件包之后,我的计算机仍在我的计算机上持续存在。
I have a custom ggplot theme that I have been using for a while now. This week I started getting an error when making plots using this theme stating that plot.new has not been called yet
I've traced the error to an axis.line()
argument which i've used before to turn my axis lines into arrows. I was able to reproduce the error below, but i'm confused why this is happening now. Does anyone know why this could be happening or possibly provide some alternatives to changing axis lines to arrows?
Eg:
library(ggplot2)
dat <- mtcars
ggplot(data = dat) +
geom_point(aes(x = wt, y = mpg)) +
theme(axis.line = element_line(color = "black", arrow = arrow(length = unit(0.3, "lines"), type = "closed")))
EDIT:
loading the graphics library (library(graphics)
) fixed the issue temporarily. However knitting the markdown file produces the same error as above. It seems my example is not reproducing the error, however it's persisting on my computer even after re-installing RStudio AND updating all packages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论