How do I keep the number of bins used the same when generating a histogram along with how do I illustrate its depth with color?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Andrew Stark
il 26 Nov 2020
Risposto: Walter Roberson
il 26 Nov 2020
%Plotting Histogram
for i=1:3000
Zf2=Zf{i,1};
Df2=Df{i,1};
H=[Df2,Zf2];
hist3(H,[10 10])
hold on
end
I am trying to generate a histogram and when set to 1 iteration it generates this histogram
when set to 2 iterations it generates this histogram
How do I keep the number of bins the same and use color to illustrate the depth of the histogram?
0 Commenti
Risposta accettata
Walter Roberson
il 26 Nov 2020
You are keeping the number of bins the same for the two histograms. The bins just are not aligned between the two plots, and you are using "hold on"
Remember that when you specify by number of bins, it takes the range of data and subdivides it into the given number of bins. When you have two different plots with different ranges, then the edges are not going to align.
You should be considering specifying bin centers or bin edges instead of numbers of bins.
For coloring use 'CDataMode', 'auto', 'FaceColor', 'interp'
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Histograms in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!