Azzera filtri
Azzera filtri

Graph bar with plot

1 visualizzazione (ultimi 30 giorni)
Emmanuelle
Emmanuelle il 28 Ago 2012
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.
(this is a screenshot. There are different values but all the rectangles are united).
Thanks in advance,
Emma

Risposte (2)

Image Analyst
Image Analyst il 28 Ago 2012
Change the BarWidth property:
m = rand(1, 5);
bar(m, 'BarWidth', 0.9);
  3 Commenti
Image Analyst
Image Analyst il 30 Ago 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?
Emmanuelle
Emmanuelle il 30 Ago 2012
Image Analyst, thanks again for your reply. I've also checked the documentation. Maybe it's the way that I'm doing the graph that is incorrect. I don't need the red line; I need that every chart has his own line, not like 'scalar' graph. I need that charts looks 'individually'. The way I've done is that:
if true
graph=0;
for p=(21:50)
graph(p)=out1;
end
for p=(151:301)
graph(p)=out2;
end
And then, this is the code to represent it:
bar(x, sensiv_graf,1.5)
This is what I want, a graph where every chart looks individual:
THANKS a lot, again. I'm going to try to change the way to load the data.

Accedi per commentare.


José-Luis
José-Luis il 29 Ago 2012
Look at the documentation
doc bar
For example:
bar(m,'g','EdgeColor','k','BarWidth',0.9)
  1 Commento
Emmanuelle
Emmanuelle il 30 Ago 2012
Thanks José-Luis, I've checked the documentation but maybe it doesn't work because it's the way that I've load the data. Thanks, i'm going to try to change! :)

Accedi per commentare.

Categorie

Scopri di più su Graphics Object Properties in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by