Skip to content
Prev 87181 / 398502 Next

2 barplots in the same graph

Le 24.02.2006 11:58, jia ding a ??crit :
ylim is not needed on the second call.
Use the outputs from barplot :

out <- barplot(x1,col="white",border="red",ylim=extendrange(c(x1,x2)))
out
axis(1, out[,1], sprintf('bar %d', 1:3))
You can use extendrange instead of range, ie :

barplot(x1,col="white",border="red",ylim=extendrange(c(x1,x2)))
abline(h=0)
Also, try :
?barplot
http://addictedtor.free.fr/graphiques/search.php?q=barplot

Romain