plotyy scaling issue...

3 次查看(过去 30 天)
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!

采纳的回答

Kelly Kearney
Kelly Kearney 2015-8-26
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?

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Two y-axis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by