plotyy scaling issue...

3 visualizaciones (últimos 30 días)
Chris E.
Chris E. el 26 de Ag. de 2015
Respondida: Kelly Kearney el 26 de Ag. de 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!

Respuesta aceptada

Kelly Kearney
Kelly Kearney el 26 de Ag. de 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?

Más respuestas (0)

Categorías

Más información sobre Two y-axis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by