plotyy scaling issue...

1 回表示 (過去 30 日間)
Chris E.
Chris E. 2015 年 8 月 26 日
回答済み: Kelly Kearney 2015 年 8 月 26 日
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 Center および File ExchangeTwo y-axis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by