How can I set the histogram width?
Mostrar comentarios más antiguos
I would like to set the histogram width in hist(), can anyone help? Thanks
Respuesta aceptada
Más respuestas (4)
Wayne King
el 13 de Oct. de 2012
0 votos
If by histogram width, you mean the width of the bins, then you can do that by specifying the number of bins you use as an input argument; this is documented.
Or use histc() and specify the edges as a vector input.
Ilaria Sani
el 13 de Oct. de 2012
0 votos
Wayne King
el 13 de Oct. de 2012
Editada: Wayne King
el 13 de Oct. de 2012
You can simply modify the width of the plot
hist(randn(1000,1))
ax = gca;
get(ax,'position')
Now you'll see a vector with 4 elements. The 4 elements are
[left bottom width height]
so add to the width value. You'll probably want to reduce the left value as well to keep the histogram "centered"
Ilaria Sani
el 15 de Oct. de 2012
0 votos
Categorías
Más información sobre Histograms en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!