虽然可以使用ggplotify::as.ggplot将gtable转换为ggplot,但输出与原始gtable不同。例如:
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
g <- ggplot_gtable(ggplot_build(p))
p_new <- ggplotify::as.ggplot(p)
# origin
p + theme(aspect.ratio = 2)
# changed
p_new + theme(aspect.ratio = 2) # different figure shape from the origin one我如何才能将gtable隐藏到中,与原始的p一样,也可以隐藏到 ggplot p_new中。
发布于 2019-05-30 10:11:17
您可以使用ggplotify::as.ggplot()
library("ggplotify")
as.ggplot(q)https://stackoverflow.com/questions/56376072
复制相似问题