ca1.gr=ggplot(ihc,aes(Latency,
CA1.GR.ir, group=Arena))+
geom_smooth(aes(fill=Arena, color=Arena),method="lm",se=FALSE,size=1)+
geom_point(aes(shape=Arena, fill=Arena, color=Arena),size=3.5)+ # add a scatter plot; constant size, shape/fill depends on stress condition
scale_x_continuous("Z-Score for Mean Latency to Approach Novelty (PND 70)",
limits=c(-3.5,3.5),
breaks=seq(-3,3,by=1))+
scale_y_continuous((expression(paste('Hippocampus CA1 GR+ cells / ', mm^{2}))),
limits=c(5,10),
breaks=seq(5,10,by=1))+
ggtitle('Figure 6a.')+
scale_shape_manual(name="Exploration Arena",
breaks=c("Novel Physical", "Novel Social"),
labels=c("Novel Physical", "Novel Social"),
values=c(21, 24))+ # explicitly have fillable shapes for each group
scale_fill_manual(name="Exploration Arena",
breaks=c("Novel Physical", "Novel Social"),
labels=c("Novel Physical", "Novel Social"),
values=c("red","black"))+
scale_color_manual(name="Exploration Arena",
breaks=c("Novel Physical", "Novel Social"),
labels=c("Novel Physical", "Novel Social"),
values=c("red","black"))+
theme_bw()+
theme(plot.title = element_text(face="bold", size=24, vjust=2, hjust=-0.1), #use theme_get() to see available options
axis.title.x = element_text(size=24, vjust=-0.5),
axis.title.y = element_text(face="bold", size=24, vjust=1.0, angle=90),
axis.text.x = element_text(size=20),
axis.text.y = element_text(size=20),
panel.border = element_rect(size = 0.5, colour = "black"),
panel.grid.major = element_blank(), # switch off major gridlines
panel.grid.minor = element_blank(),
legend.justification = c(1,1),
legend.position = c(1,1), # manually position the legend (numbers being from 0,0 at bottom left of whole plot to 1,1 at top right)
legend.title = element_text(face="bold", size=15),
legend.text = element_text(size=15),
legend.key.size = unit(1.0, "lines"),
legend.key = element_blank()) # switch off minor gridlines
The additional warnings are ok because they don't affect my figure. However, the manual scale thinks I need 3 values when there are only two in the data set. Any idea why this is happening?