plotyy scaling issue...

3 Ansichten (letzte 30 Tage)
Chris E.
Chris E. am 26 Aug. 2015
Beantwortet: Kelly Kearney am 26 Aug. 2015
I'm still trying to figure out the scaling issue for the plotyy bar, I have had very little success. The issue is I still get two bars being plotted for one bin. Here is the code:
rest = [330;
0;
3187;
0;
0;
0;
0;
0;
0;
0;
0;
17;
0];
rest_percent = [0.0934;
0;
0.9018;
0;
0;
0;
0;
0;
0;
0;
0;
0.0048;
0];
plotyy(1:13,rest_percent,1:13,rest,'bar','bar');
It looks like this when I plot it on my matlab, it very well could be a MATLAB version issue, but I do not know yet:
If you look at the blue bars, there is a black line separating the two bins, it seems that it is not scaling correctly. Please any help will be great!

Akzeptierte Antwort

Kelly Kearney
Kelly Kearney am 26 Aug. 2015
Looks correct to me... You're getting two sets of bars. You can change the bar properties to see that more clearly.
[ax, h1, h2] = plotyy(1:13,rest_percent,1:13,rest,'bar','bar');
h2.FaceColor = 'r';
h2.BarWidth = 0.6;
The blue bars correspond to the rest_percent axis on the left and the red ones to the rest axis on the right. What were you expecting instead?

Weitere Antworten (0)

Kategorien

Mehr zu Two y-axis finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by