函数scale_size_manual()是';t在R中使用ggplot()时影响点的大小

函数scale_size_manual()是';t在R中使用ggplot()时影响点的大小,r,ggplot2,R,Ggplot2,我第一次使用了函数scale\u size\u manual()。我正在尝试使用以下脚本减小点的大小: p2<-ggplot(data = dfnew, aes(x = Area, y = Proportion, group=linegroup)) + geom_point(aes(shape = as.character(Collar)), size = 6, stroke = 0, position = myjit)+ geom_line(aes(g

我第一次使用了函数
scale\u size\u manual()
。我正在尝试使用以下脚本减小点的大小:

p2<-ggplot(data = dfnew, aes(x = Area, y = Proportion, group=linegroup)) +
  geom_point(aes(shape = as.character(Collar)), size = 6, stroke = 0, 
             position = myjit)+
  geom_line(aes(group = linegroup),linetype = "dotted",size=1, position = myjit) +
  theme(axis.text=element_text(size=15),
        axis.title=element_text(size=20)) +
  geom_errorbar(aes(ymin = Lower, ymax = Upper), width=0.3, size=1,
                position = myjit) + scale_shape_manual(values=c("41361´"=19,"41365´"=17)) + scale_size_manual(values=c(2,2)) +
  scale_color_manual(values = c("SNP" = "black", 
                                "LGCA" = "black")) + labs(shape="Collar ID") + ylim(0.05, 0.4)

您正在使用参数
size
geom_point
层中设置点的大小

geom_point(aes(shape = as.character(Collar)), size = 6, stroke = 0, 
           position = myjit)+
在您的案例中,减小点大小的唯一方法是减小
大小
,例如,减小到4

geom_point(aes(shape = as.character(Collar)), size = 4, stroke = 0, 
           position = myjit)+
如果大小在数据中使用变量映射到aes中,则只能使用
scale\u size\u manual
,如下例所示

ggplot(data = dfnew, aes(x = Area, y = Proportion, group = linegroup, size = Area))

您正在使用参数
size
geom_point
层中设置点的大小

geom_point(aes(shape = as.character(Collar)), size = 6, stroke = 0, 
           position = myjit)+
在您的案例中,减小点大小的唯一方法是减小
大小
,例如,减小到4

geom_point(aes(shape = as.character(Collar)), size = 4, stroke = 0, 
           position = myjit)+
如果大小在数据中使用变量映射到aes中,则只能使用
scale\u size\u manual
,如下例所示

ggplot(data = dfnew, aes(x = Area, y = Proportion, group = linegroup, size = Area))

您正在使用
size=6
geom_point
调用中控制点大小
scale\u size\u manual
aes()
调用中获取一个映射到尺寸美学的值,并允许您控制生成的尺寸值。@JonSpring我用
ggplot(data=dfnew,aes(x=时间,y=比例,group=linegroup,scale\u size\u manual(values=c(1,1))
作为第一个命令行尝试了相同的脚本。点的大小保持不变。这就是您想要表达的吗?您正在使用
size=6
控制
geom_点
调用中的点大小
scale\u size\u manual
aes()
调用中获取一个映射到尺寸美学的值,并允许您控制生成的尺寸值。@JonSpring我用
ggplot(data=dfnew,aes(x=时间,y=比例,group=linegroup,scale\u size\u manual(values=c(1,1))
作为第一个命令行尝试了相同的脚本。点的大小保持不变。这就是你想要表达的吗?