Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R Can';t在两条线上获得长y轴标签_R_Label_Axis - Fatal编程技术网

R Can';t在两条线上获得长y轴标签

R Can';t在两条线上获得长y轴标签,r,label,axis,R,Label,Axis,这是我对两个独立数字的代码 一, g1 EmilyShore,如果有样本数据,我们可以测试您的代码,这将非常有帮助。请使用公共数据集(例如,mtcars,iris,ggplot2::diamonds),或使用dput(head(daat,n))提供足够的数据样本,其中n足够大,可以绘制一些东西,但对于问题来说不是太大。谢谢 g1 <- ggplot(data=daat, mapping=aes(x=treatment, y=total_volume)) + geom_boxplot() +

这是我对两个独立数字的代码

一,


g1 EmilyShore,如果有样本数据,我们可以测试您的代码,这将非常有帮助。请使用公共数据集(例如,
mtcars
iris
ggplot2::diamonds
),或使用
dput(head(daat,n))
提供足够的数据样本,其中
n
足够大,可以绘制一些东西,但对于问题来说不是太大。谢谢
g1 <- ggplot(data=daat, mapping=aes(x=treatment, y=total_volume)) + geom_boxplot() +
geom_boxplot(fill=colors) + theme_bw(base_size = 15.3) +
ylab(expression(paste("Total Matter (",mu, m^3," ",individual^{-1},")", sep=""))) + 
theme(panel.grid.major = element_blank(), axis.title.x=element_blank(),       panel.grid.minor = element_blank()) +
scale_x_discrete(labels=c("Control","Plastic")) +
geom_text(y=starsheight[1]+off,x=2,size=9, label = "***") +
labs(tag = "C") +
theme(plot.tag = element_text(vjust = 5))
g2 <- ggplot(data=daat, mapping=aes(x=treatment, y=apoop)) + geom_boxplot() +
geom_boxplot(fill=colors) + theme_bw(base_size = 15.3) +
#ylab(ylab) +
ylab(expression("Number of Pellets" ~ (individual^{-1}))) + xlab("Treatment") +
theme(panel.grid.major = element_blank(), axis.title.x=element_blank(),  panel.grid.minor = element_blank()) +
scale_x_discrete(labels=c("Control","Plastic")) +
geom_text(y=starsheight[1]+off,x=2,size=9, label = "*") +
labs(tag = "B") + 
theme(plot.tag = element_text(vjust = 5))