Two y-axis colors

조회 수: 526 (최근 30일)
Lynn
Lynn 2019년 10월 30일
댓글: Lynn 2019년 11월 2일
Hello, and thanks for the help given to me earlier.
I have created -- thanks to MATLAB help -- a graph with two y axes. The default colors appear to be blue and red. Is there a way that I can make all the lines and labels black? I can't seem to find that way anywhere.
Many thanks.
Lynn

채택된 답변

Thomas Satterly
Thomas Satterly 2019년 10월 30일
Assuming you did something similar to the code below, you can access the axis properties directly and change the color to whatever you want.
% Create a figure and axis with 2 Y axes
figure;
ax = axes; % or ax = gca();
yyaxis('left');
yyaxis('right');
% Set the color of each axis to black
ax.YAxis(1).Color = [0 0 0];
ax.YAxis(2).Color = [0 0 0];
  댓글 수: 1
Lynn
Lynn 2019년 11월 2일
Many thanks. That did it!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by