How to add only a fragment of bar to bar graph (not from 0)?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello. I am trying to modify my bar graph. I have a several datas, limited x asis (in a way I want) and I would like to add only a fragment (not from 0 but from d1 to d1+t1, I calculated d1 and t1) of two bars (with different colors) to existing to bars. When I'm trying to plot h3=bar([uHV_sr1 - t1, uHV_sr1 + t1], [d1,1d1], 4, 'm'); all green on this plot (not from some poinnt, for example 300=d1) comes into magenta.
I am not keen on Matlab and I tried several ways to manage it (with set for example), but failed. I am working on 2013 release. How can I solve it?
figure(1)
h1=bar(uHV_sr1, d1,4,'g'); %x1 i x2 to rzędna i odcięta jak zwykle, 1 to "szeroko?ć na stronę" słupka i ostatni to kolor
hold on
h2=bar(uHV_sr1, d1,0.2,'k') ;
%h3=bar([uHV_sr1 - t1, uHV_sr1 + t1], [d1,1d1], 4, 'm');
ax=h3
set(h3, 'yticklabel');
%h3lim ([290 398])
hold on
h4=bar(uHV_sr2, d2,5, 'b');
h5=bar(uHV_sr2, d2,0.65,'c');
%hold on
xlim ([290 398])
%legend('1','2','3','4', 'Location','best')
xlabel ('5')
ylabel ('{\mu')
%title('Za jakie grzechy? ')
0 Kommentare
Antworten (2)
Walter Roberson
am 2 Feb. 2018
For any one barseries object, you can set the BaseValue property; see https://www.mathworks.com/help/releases/R2013a/matlab/ref/barseriesproperties.html
This does not permit you to set the bar bases individually: for that you should consider patch() or fill()
0 Kommentare
A N
am 3 Feb. 2018
1 Kommentar
Walter Roberson
am 3 Feb. 2018
Any one bar() call that you make has to have the same BaseValue. You can make multiple bar() calls, or you could convert your bar() calls into calls to patch() or fill(), or you could make a series of calls to rectangle()
Siehe auch
Kategorien
Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!