Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Peter
Posts:
91
Registered:
7/24/10


Compare 2 histograms, when "hist" is in a subplot
Posted:
Jun 30, 2014 4:01 AM


I plot 2 histogram *subplots*. I want to compare them, not just by eye. I want to plot hist(A)  hist(B). That is, they look similar. But I want to plot the difference of the histograms.
The Help tells me I can return the 'hist' values  ie the "qty" per "bin".
step 1: z(1)=hist(E(1,:),nbins); step 2: z(2)=hist(E(2,:),nbins); step 3: "plot something using z(1)z(2)"
But I the first 2 histograms are in a subplot and that messes things up:
subplot(1,3,1), hist(E(1,:),nbin)  that works subplot(1,3,1), z(1)=hist(E(1,:),nbin);  that doesn't work
Note: I don't want to subtract curve B from curve A and then "hist". I want to compare the 2 histograms.
Will appreciate any help.
Thanks



