I am plotting two histograms on the same graph:
g1 = Histogram[bc, ChartStyle -> {Red}]
g2 = Histogram[bcx]
Show[g1, g2, PlotRange -> {{0.1, 0.6}, All}]

But I would like the plots to overlap so that they are "see-through" and I can compare them. I've been trying with
ChartStyle -> {"Overlapped"}
which hasn't been working.
Answer
First method
You could make the one in front partially transparent:
bc = RandomVariate[NormalDistribution[], 1000];
bcx = RandomVariate[NormalDistribution[], 1000];
g1 = Histogram[bc, ChartStyle -> {Red}];
g2 = Histogram[bcx, ChartStyle -> {Directive[Blue, Opacity[.5]]}];
Show[g1, g2, PlotRange -> All]

Direct method
The same effect can be achieved by plotting the two distributions in the same plot directly:
Histogram[{bc, bcx}, ChartStyle -> {Red, Blue}]
Comments
Post a Comment