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

From: Carl Witthoft <carl_at_witthoft.com>
Date: Fri, 20 Jun 2008 16:34:58 -0400


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.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 20 Jun 2008 - 20:55:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 20 Jun 2008 - 21:31:56 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive