change the color of the second Y-axis

19 次查看(过去 30 天)
ı just want to change the color of the y axis to black how can i do this could you please write the code to change this

回答(1 个)

Voss
Voss 2024-2-27
yyaxis('left')
plot(1:10);
yyaxis('right')
plot(10:-1:1)
ax = gca(); % the current axes is the right axes at this point
ax.YColor = 'k'; % set the right axes YColor to black

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by