Plotyy with bars stacked
4 次查看(过去 30 天)
显示 更早的评论
I am trying to do a matlab plot with two y axes. I want both to plots to be of type 'bars'. I can't work out how to make them stacked an how to hace axes going from 1:3 with out overlapping each other.
Here's what I do.
y = {rand(x, 1) * 100; (-0:(0.8)/(x-1):0.8)'};
fn1=@(x,y) bar(x , y, 0.3, 'FaceColor','r');
fn2=@(x,y) bar(x , y, 0.3, 'FaceColor','b');
[ax, hbar1, hbar2]=plotyy(1:2:6, y{1},2:2:6,y{2} ,fn1,fn2);
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two y-axis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!