How to assign variable width bins in histogram?

3 visualizaciones (últimos 30 días)
Jameel Qadri
Jameel Qadri el 8 de Nov. de 2017
Comentada: Steven Lord el 8 de Nov. de 2017
I want to plot my data as a histogram but each bar in the histogram has a different bin width given by another data sequence.Thanks.

Respuestas (1)

Guillaume
Guillaume el 8 de Nov. de 2017
Calculate the edges of your bins according to your other data sequence, pass that as the second input of histogram.
  1 comentario
Steven Lord
Steven Lord el 8 de Nov. de 2017
As an example of this technique see the "Specify Bin Edges of Histogram" example in the documentation for the histogram function. In that example there are two very wide bins at the ends of the histogram capturing the outliers in the data.

Iniciar sesión para comentar.

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