I'm trying to plot a scatterplot with errorbars together with a barplot. Both variables have a very different range (scatterplot 0 - 20000+; bar chart 0-1). So I want to create a plot with both graphs in it, with two different y-axes. This is what I've got so far:
ggplot(data, aes(x=seaname, y=chao2)) + geom_bar(stat="identity",
aes(x=seaname, y=compl, colour=major_sea)) + geom_point(aes(colour=major_sea))
+ geom_errorbar(aes(ymin=chao2_lower, ymax=chao2_upper,
colour=major_sea)) + theme(axis.text.x=element_text(angle=90,
vjust=0.5, size=9))
Just to clarify: I don't want two graphs represented below each other. I would like them in the same, single graph. Anyone who has experience with this kind of problem?
Cheers!!