Incorrect color switching when using errorbar() and plotyy()?
1 view (last 30 days)
Show older comments
The code below is intended to plot points with errorbars and draw 2 lines. It should give the lines different colors, yet it does not. If you run the plotyy() command twice, one line + axis changes color. Is this behavior intended?
close all;
figure;
% Create dummy data
x=[1 2 3];
y=[1 2 3];
s=[0.2 0.1 0.3];
% add noise
y1=y*randi(10,3)/10;
y2=y*randi(10,3)/10;
% Plot
errorbar(x,y,s);
hold on
plotyy(x,y1,x,y2)
0 Comments
Answers (0)
See Also
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!