[R] Plotting barplot and scatterplot on same device - x-axis problem

Carl Witthoft carl at witthoft.com
Fri Jun 20 22:34:58 CEST 2008


As an alternative to the other suggestions,
I've found it just as easy to make the bar plot using plot() .

Assuming I've run hist()->sudh,  then do

plot(sudh$breaks[1:length(sudh$breaks)-1],sudh$counts,type='h',lwd={pick_a_width_you_like))

Then it's easy to drop some scatterplot points or lines on top of that.



More information about the R-help mailing list