I wrote a ggplot2 script that produces a plot with 3 points and associated error bars. On my computer it works fine, but the same script run on a colleague's computer omits the x and y axes. Any idea why the same ggplot2 code would produce axes on one computer but not another?
I've pasted the code below. for_group_code is a factor with 3 levels. CIlo, CIhi, and y are continuous variables (mean and associated 95% confidence intervals):
Plotnewdat.fg <- ggplot(newdat.fg, aes(x=for_group_code, y=y)) +
geom_point(aes(shape=dum, size=10)) +
scale_shape_manual(values=c(1,0,15)) +
geom_errorbar(aes(ymin=(CIlo), ymax=(CIhi)), size=1, width=0) +
scale_fill_identity()+
scale_x_discrete(labels=newdat.fg$for_group_code)+
xlab("")+
ylab("Density") +
scale_y_continuous(expand=c(0,0), limits=c(0, ymax), breaks=c(0,round((ymax/2), digits=1),ymax)) +
theme(axis.text.x=element_text(size=10, colour="#000000"), axis.text.y=element_text(size=10, colour="#000000"),
axis.title.x=element_text(size=10, colour="#000000"), axis.title.y=element_text(size=10, vjust=1.0),
panel.background = element_blank(), panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
axis.line = element_line(colour = "black"), plot.title=element_text(face="bold", size=10, vjust=0.9),
legend.position="none")
Plotnewdat.fg