Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/77.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';GGS图_R_Ggplot2_Plot_Data Visualization - Fatal编程技术网

将位置偏移添加到R';GGS图

将位置偏移添加到R';GGS图,r,ggplot2,plot,data-visualization,R,Ggplot2,Plot,Data Visualization,在R中,我目前有这个ggplot: 我想把标题放在广场中央,像这样: 我查看了?元素\u文本,但没有位置/偏移设置。如何在ggplot中移动偏移x轴?可以尝试使用我添加的主题() library(ggplot2) #Code ggplot(iris,aes(x=Species,y=Sepal.Length))+ geom_boxplot(aes(fill=Species))+ theme(axis.text.x = element_text(angle = 90,vjust = 0.

在R中,我目前有这个
ggplot

我想把标题放在广场中央,像这样:


我查看了
?元素\u文本
,但没有位置/偏移设置。如何在
ggplot
中移动偏移x轴?

可以尝试使用我添加的
主题()

library(ggplot2)
#Code
ggplot(iris,aes(x=Species,y=Sepal.Length))+
  geom_boxplot(aes(fill=Species))+
  theme(axis.text.x = element_text(angle = 90,vjust = 0.5))
输出:


也许可以尝试使用我添加的
主题()

library(ggplot2)
#Code
ggplot(iris,aes(x=Species,y=Sepal.Length))+
  geom_boxplot(aes(fill=Species))+
  theme(axis.text.x = element_text(angle = 90,vjust = 0.5))
输出: