How to combine two histograms
65 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
SS
am 23 Aug. 2019
Beantwortet: Steven Lord
am 23 Aug. 2019
I have two different histogram plots with same axes limits. I want to combine them such that, I can make comparison between two different cases. How can, I do this?
0 Kommentare
Akzeptierte Antwort
Steven Lord
am 23 Aug. 2019
Combine them as in show them in the same axes with the same bins, combine them as in add the bin counts together, or something else?
If the first, call hold between your histogram calls. See the "Plot Multiple Histograms" example on the histogram documentation page. You may want to set each histogram object's BinEdges to be the same if the data isn't as closely aligned as you want, or you may want to select both histogram objects (click the arrow in the figure toolbar, shift-left-click each histogram) then open the context menu by right-clicking and select the "Align Bins" option.
If you want to add the bin counts together, I'd probably call histcounts for each of your data sets with the same BinEdges, then call histogram and pass in the common BinEdges option you used in your histcount calls and the combined bin counts as the BinCounts. This is the "histogram('BinEdges',edges,'BinCounts',counts)" syntax listed in the Creation section of that documentation page.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!