Is it possible draw left y-axis with red color and the right y-axis with blue color?
조회 수: 9 (최근 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에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!