Sign up ×
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: – SlowLearner May 23 '12 at 3:11
can't you simply "record" a macro while creating exactly what you want and the alternate the code to do it automaticly in the future? if you have any troubles you are welcome to come back and ask for help... – Dirk Reichel Nov 7 at 21:04

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.