Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With a standard 1D histogram, I can generate a pdf overlay using Show and Plot.

I'd like to do something similar with PairedHistogram. I can't find any examples. I have tried using Epilog, but I can't figure out how to pass the graphics primitive correctly such that they are matched to the correct histogram.

I'd like to add overlays to the below, with an overlay specified for each histogram in the pair.

share|improve this question

migrated from Nov 8 '12 at 22:07

This question came from our site for professional and enthusiast programmers.

+1 That's one nice question! – Sasha Nov 8 '12 at 22:16
up vote 9 down vote accepted

It's not beautiful, but you can use ParametricPlot adjusted by the BarSpacing to accomplish this.

With[{bs = .1}, 
          RandomVariate[NormalDistribution[], 100], 
          RandomVariate[UniformDistribution[{-3, 3}], 1000],
          Automatic, "PDF", ChartStyle -> {{LightOrange, LightBlue}, None, None}, 
          BarSpacing -> bs], 

         ParametricPlot[{PDF[UniformDistribution[{-3, 3}], t] + bs/2, t}, 
            {t, -3, 3}, Axes -> None], 
         ParametricPlot[{-PDF[NormalDistribution[], t] - bs/2, t}, 
            {t, -3, 3}, Axes -> None], PlotRange -> All]

enter image description here

share|improve this answer
Awesome, thanks! – jfelectron Nov 8 '12 at 23:59

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.