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

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
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.