Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I create these kinds of graphs:

Wanted graphs.

with the horizontal histogram counting the number of times the left graphs go through a certain range?

I have access to Microsoft Excel and R.

share|improve this question
"Gemeotric"... *Gnnnhhhh* –  Daniel Andersson May 22 '12 at 16:04
hahahaha, yeah. –  Jimi May 22 '12 at 16:38
Using R, I would create two plot objects in ggplot2, a line chart and a histogram, then arrange them both on the same plot using grid.arrange(), pushViewport and viewport() then export to a file. But that is not a trivial undertaking, unless you are already an R expert. Otherwise your best bet may be to make two charts in Excel and stitch them together in a graphics application like GIMP or using ImageMagick. If you need to do this kind of thing on a regular basis, it might well be worth getting familiar with ggplot (or one of the other R graphics packages). –  SlowLearner May 23 '12 at 3:04
The R code for the 'combining multiple plots into one' ggplot2 approach I just mentioned is given in the ggplot book and can be found right at the bottom of this page: had.co.nz/ggplot2/book/polishing.r –  SlowLearner May 23 '12 at 3:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.