plotyy scaling issue...

3 visualizzazioni (ultimi 30 giorni)
Chris E.
Chris E. il 26 Ago 2015
Risposto: Kelly Kearney il 26 Ago 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!

Risposta accettata

Kelly Kearney
Kelly Kearney il 26 Ago 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?

Più risposte (0)

Categorie

Scopri di più su Two y-axis in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by