Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.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 geom方框图中的标题_R_Ggplot2_Boxplot - Fatal编程技术网

R geom方框图中的标题

R geom方框图中的标题,r,ggplot2,boxplot,R,Ggplot2,Boxplot,我想为我的qqplot图添加x和y标签。但这并不成功。我的图表采用列标题,而不是指定的标题。谁能告诉我哪里出了错吗?我的剧本如下 setwd("F:/Research/Fieldwork SL-data/Seed predation and seed no/Seed No") seednumber<-read.csv(file="seed number -analysis 3.csv", header=TRUE, sep=',') attach(seednumber) names(seed

我想为我的qqplot图添加x和y标签。但这并不成功。我的图表采用列标题,而不是指定的标题。谁能告诉我哪里出了错吗?我的剧本如下

setwd("F:/Research/Fieldwork SL-data/Seed predation and seed no/Seed No")
seednumber<-read.csv(file="seed number -analysis 3.csv", header=TRUE, sep=',')
attach(seednumber)
names(seednumber)

aes
创建一个未经验证的表达式列表,描述数据中的变量如何映射到几何图形的视觉特性

xlab
ylab
不算作
geoms
的视觉特性,它们是定义
x
y
轴的
比例的标签

您可以用多种方式定义这些

# given a base plot
baseplot <- ggplot(seednumber, aes(x = Study.Site, y = Seed.Number, colour = Country)) +
            geom_boxplot()
注意:您可以使用
labs
更改任何刻度的标签(包括在
aes
中映射的刻度)

2) 。使用相关的
scale\uu…\ u…
功能,您可以更好地控制
scales

乙二醇

# given a base plot
baseplot <- ggplot(seednumber, aes(x = Study.Site, y = Seed.Number, colour = Country)) +
            geom_boxplot()
baseplot + labs(x = "Study Site", y = "Number of seeds in a podr")
# or
baseplot + xlab("Study Site") + ylab("Number of seeds in a podr")
baseplot + scale_x_discrete(name = "Study Site") + 
  scale_y_continuous(name = 'Number of seeds in a podr')