I want to plot stacked histograms in R; i.e. stack individual histograms in the third dimension.
thank you all for your suggestions, especially the one by Shane.
@hadley, I agree with your points, however, my situation is different: the main point I’m trying to convey by plotting four stacked histograms is that the tails vary significantly….the part that will get obscured is of no consequence in the data I’m presenting….also, being able to read the frequency axis is also not important since I’ll be plotting the relative frequencies…
You could try using either
rgl(see here) or3dscatterplot(as in this example). Lattice also supports this:You can see an example of this on the Learnr blog.
I don’t believe that’s technically a stacked histogram (a stacked histogram stacks the bars on top of each other). Moreover, a different kind of histogram could be more informative: look at the
ggplot2the documentation here for some examples.Another option is to use latticing instead, with
facet_wrapin ggplot2 (see this post as an example).