Filter löschen
Filter löschen

Two y-axis colors

571 Ansichten (letzte 30 Tage)
Lynn
Lynn am 30 Okt. 2019
Kommentiert: Lynn am 2 Nov. 2019
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

Akzeptierte Antwort

Thomas Satterly
Thomas Satterly am 30 Okt. 2019
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 Kommentar
Lynn
Lynn am 2 Nov. 2019
Many thanks. That did it!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by