Graph bar with plot
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi! I've created a graph bar with plot but the rectangles are united. I want them independent and I don't know how to do it.
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
(this is a screenshot. There are different values but all the rectangles are united).
Thanks in advance,
Emma
0 comentarios
Respuestas (2)
Image Analyst
el 28 de Ag. de 2012
Change the BarWidth property:
m = rand(1, 5);
bar(m, 'BarWidth', 0.9);
3 comentarios
Image Analyst
el 30 de Ag. de 2012
If you want red bars going up to the top of the shorter bar between a pair of bars, then you'll have to use the line() function, though you might be able to use the stem() function. I don't know off the top of my head how to do it - I'd have to research it by looking in the help, like you. I figure you can do that as well as me. Can you do that? Why do you want such a specialized, non-standard presentation anyway? I think your chart is kind of distracting and confusing. Why won't normal bar charts work for you?
José-Luis
el 29 de Ag. de 2012
Look at the documentation
doc bar
For example:
bar(m,'g','EdgeColor','k','BarWidth',0.9)
Ver también
Categorías
Más información sobre Graphics Object Properties en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!