Box plot + dotchart/barplot

5 views
Skip to first unread message

Pawlok Dass

unread,
Jun 20, 2017, 5:30:03 PM6/20/17
to Davis R Users' Group
I need to make an X-Y plot where the first two columns will represent a range of values and the next four columns will represent a single value. So an appropriate representation would be 2 box plots followed by 4 dot-charts or bar plots. While it sounds simple enough, I am unable to find the correct syntax to do this. Please help.

So this is working for me (but the plot isn't pretty):
boxplot(trendy.GlobSum, trendy.N.GlobSum, ylab='GPP (PgC)', main='High lat. global GPP')
axis(1, at=c(1,2), labels=c('TRENDY','TRENDY-Nlim'))
abline(h=lpj.nfix.GlobSum, lwd=2, col='green')
abline(h=lpj.ndep.GlobSum, lwd=2, col='red')
abline(h=lpj.rockn.GlobSum, lwd=2, col='blue')
abline(h=lpj.rockn2A.GlobSum, lwd=2, col='blue', lty=2)

This is what I would want ideally:
boxplot(trendy.GlobSum, trendy.N.GlobSum, ylab='GPP (PgC)', main='High lat. global GPP')
axis(1, at=c(1,2), labels=c('TRENDY','TRENDY-Nlim'))
barplot(lpj.ndep.GlobSum, beside=T, add=T, width=0.25, xpd=F)

Ideally of course I would want to replace 'barplot' with 'dotchart'. But I don't think a 'dotchart' can be added to a plot.

Many thanks,
Pawlok
Reply all
Reply to author
Forward
0 new messages