legend for plotyy causes axes problem
Show older comments
Hello!
Can anyone help me?
The legend in my plot generated by plotyy causes a displacement of one y-axis.
Does anyone knows a solution? Thanks
x = 1:100;
y1= randn(1,length(x));
y2= randn(1,length(x));
y3= randn(1,length(x));
y4= randn(1,length(x));
% plot1
[hA,h1,h2] = plotyy(x,y1,x,y2);
hold on
% plot2
[hB,h3,h4] = plotyy(x,y3,x,y4);
hold off
legend([h1,h2,h3,h4],'a','b','c','d','location','northoutside','orientation','horizontal')
refresh
Accepted Answer
More Answers (0)
Categories
Find more on Two y-axis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!