how to change the two y axis label color ?

조회 수: 6 (최근 30일)
Akim Mahmud
Akim Mahmud 2018년 2월 7일
댓글: Swetha Meenakshi-Sundaram 2019년 10월 7일
Hi I have a two y axis label plot. left hand y axis is blue and right left y axis is black. I want to change the right hand y axis to orange color label ? any help ? Thanks
  댓글 수: 3
Shashank
Shashank 2018년 2월 13일
Hi Akim,
The following MATLAB Answers thread discusses a similar issue:
Hope this helps
-Shashank
Swetha Meenakshi-Sundaram
Swetha Meenakshi-Sundaram 2019년 10월 7일
Hello,
I have a similar problem, but I have used yyaxis instead of plotyy (primary and secondary axes). I need to change the colors of the y axes to match the respective line colors (in this case, Energyblue and Energygreen defined below) Please help. Code below:
figure(3);
Energyblue = [0 177/255 235/255]; % line color RGB converted to 0-1 scale
Energygreen = [62/255 216/255 195/255]; % line color RGB converted to 0-1 scale
yyaxis left
plot(timestamp,SoC,'color',Energyblue,'LineWidth',1.5)
xtickformat('hh:mm a')
ylabel('% SoC')
yyaxis right
plot(timestamp,RTprice,'color',Energygreen,'LineWidth',1.5)
title('Avg Soc and RT prices')
xlabel('Timestamp')
ylabel('$/MWh')
legend('Avg SoC','RT Prices')

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by