Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.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 增加ggplot中条之间的间距_R_Ggplot2 - Fatal编程技术网

R 增加ggplot中条之间的间距

R 增加ggplot中条之间的间距,r,ggplot2,R,Ggplot2,我有一个: p您也可以调整位置减淡之外的宽度(在几何图形栏中) 或 dodge谢谢,但我仍然不清楚是什么控制因素之间的间距和治疗之间的间距。也就是说,我如何调整您的代码,使因素保持在一起,但稍微减小它们之间的间距?基本上是你的第二个插图,但有空格reduced@fugu只需将两个宽度(位置和条)都增加到,比如说,0.7 p <- ggplot(data=df, aes(x=Gene, y=FC, fill=expt, group=expt)) p <- p + geom_bar(c

我有一个:


p您也可以调整
位置减淡
之外的宽度(在
几何图形栏中


dodge谢谢,但我仍然不清楚是什么控制因素之间的间距和治疗之间的间距。也就是说,我如何调整您的代码,使因素保持在一起,但稍微减小它们之间的间距?基本上是你的第二个插图,但有空格reduced@fugu只需将两个宽度(位置和条)都增加到,比如说,0.7
p <- ggplot(data=df, aes(x=Gene, y=FC, fill=expt, group=expt))
p <- p + geom_bar(colour="black", stat="identity", position = position_dodge(width = 0.9))
p <- p + geom_errorbar(aes(ymax = FC + se, ymin = FC, group=expt),
                position = position_dodge(width = 0.9), width = 0.25)
p
ggplot(data=df, aes(x=Gene, y=FC, fill=expt, group=expt)) +
  geom_bar(colour="black", stat="identity", position = position_dodge(width = 0.8), width=0.5) +
  geom_errorbar(aes(ymax = FC + se, ymin = FC, group=expt),
                position = position_dodge(width = 0.8), width = 0.25)
dodge <- position_dodge(width = 0.5)

ggplot(data=df, aes(x=Gene, y=FC, fill=expt, group=expt)) +
  geom_bar(colour="black", stat="identity", position=dodge, width=0.5) +
  geom_errorbar(aes(ymax = FC + se, ymin = FC, group=expt),
                position = dodge, width = 0.25)