0
$\begingroup$

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.

$\endgroup$
2
$\begingroup$
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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