Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Here is the code I thought might yield up two histograms and two binomial distributions plotted side by side:

Show[Histogram[dataA, {-0.5, 6.5, 1}, "PDF"], 
 Histogram[dataC, {4.5, 12.5, 1}, "PDF"], 
 DiscretePlot[PDF[BinomialDistribution[6, 0.5], x], {x, 0, 7}, 
  PlotStyle -> PointSize[Large]], 
 DiscretePlot[PDF[BinomialDistribution[7, 0.65], x - 5], {x, 5, 13}, 
  PlotStyle -> PointSize[Large]]]

No workee! I get the first Histogram and the first Binomial. But, unfortunately, the image terminates at a value of around 7.25.

share|improve this question

1 Answer 1

dataA = RandomVariate[BinomialDistribution[6, 0.5], 100];
dataC = RandomVariate[BinomialDistribution[7, 0.65], 100] + 5;
Show[Histogram[Evaluate[{dataA, dataC}], {-0.5, 13, 1}, "PDF"], 
DiscretePlot[PDF[BinomialDistribution[6, 0.5], x], {x, 0, 7}, 
PlotStyle -> PointSize[Large]], 
DiscretePlot[PDF[BinomialDistribution[7, 0.65], x - 5], {x, 5, 13}, 
PlotStyle -> PointSize[Large]]]

enter image description here

share|improve this answer
    
Dear Mister PatoCriollo: Thanks a bunch. That's exactly what I was looking for. @PatoCriollo –  Joel Mayer Aug 6 '13 at 18:44

Your Answer

 
discard

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.