Is it possible draw left y-axis with red color and the right y-axis with blue color?
1 次查看(过去 30 天)
显示 更早的评论
and use different colors for the left ylabel and right ylabel?
0 个评论
采纳的回答
Ryan Takatsuka
2018-7-23
Yes it is. Here is an example of a plot with different y axis colors:
t = linspace(0,1,1000);
a = sin(2*pi*t);
b = sin(4*pi*t);
fig = figure;
left_color = [1 0 0];
right_color = [0 0 1];
set(fig,'defaultAxesColorOrder',[left_color; right_color]);
yyaxis left
plot(t, a)
yyaxis right
plot(t, b)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!