首页 > 解决方案 > 如何在 ggiNEXT 图中编辑 X 轴和 Y 轴的标签?

问题描述

我的问题是,如何在 ggiNEXT 的图中编辑 X 轴和 Y 轴的标签?

data(spider)
str(spider)
out=iNEXT(spider, q=0, datatype="abundance")
spider_plot=ggiNEXT(out, type=1, facet.var="site", color.var="order")
spider_plot

标签: r

解决方案


ggiNEXT是 iNEXT 对象的 ggplot2 扩展。这只是意味着在创建对象后,您可以使用 ggplot2 命令来操作绘图。

library(iNEXT)
library(ggplot2)
data(spider)
out <- iNEXT(spider$Girdled, q=0, datatype="abundance")
spider_plot <- ggiNEXT(out, type=1, facet.var="site", color.var="order")

# add ggplot2 adjustments via labs
spider_plot + labs(x = "my x label text", y = "my y label text")

推荐阅读