How to draw an histogram?

4 visualizaciones (últimos 30 días)
Prince
Prince el 7 de Mayo de 2024
Respondida: Steven Lord el 8 de Mayo de 2024
I have two set of data in which i Know the frequencies of both. How do I draw the histograms of the two set of data on the same graph?

Respuestas (1)

Steven Lord
Steven Lord el 8 de Mayo de 2024
So you know the bin edges and the bin counts? Call histogram with 'BinEdges' and 'BinCounts' along with the vectors of bin edges and bin counts.
binedges = (1:5).^2; % let's use some non-uniformly spaced edges
bincounts = [33 62 17 50]; % arbitrary values
histogram('BinEdges', binedges, 'BinCounts', bincounts)
To put multiple graphs on the same axes, use the hold function.

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by