MATLAB Colors

MATLAB’s blue short code and its first automatic plot color are different choices.

No items found.

Eight named colors and short codes

RGB triplets below use MATLAB’s 0–1 scale.

red

Short code: r

[1 0 0]

#FF0000

green

Short code: g

[0 1 0]

#00FF00

blue

Short code: b

[0 0 1]

#0000FF

cyan

Short code: c

[0 1 1]

#00FFFF

magenta

Short code: m

[1 0 1]

#FF00FF

yellow

Short code: y

[1 1 0]

#FFFF00

black

Short code: k

[0 0 0]

#000000

white

Short code: w

[1 1 1]

#FFFFFF

gem palette: R2025a and later

The seven positions below use the revised gem palette for light-theme plots. The dark-theme default is glow; earlier gem values differ. MathWorks documents both the named colors and the palette revision.

gem 1

Palette position: 1

[0.066 0.443 0.745]

#1171BE

gem 2

Palette position: 2

[0.866 0.329 0]

#DD5400

gem 3

Palette position: 3

[0.929 0.694 0.125]

#EDB120

gem 4

Palette position: 4

[0.521 0.086 0.819]

#8516D1

gem 5

Palette position: 5

[0.231 0.666 0.196]

#3BAA32

gem 6

Palette position: 6

[0.184 0.745 0.937]

#2FBEEF

gem 7

Palette position: 7

[0.819 0.015 0.545]

#D1048B

Plot seven series

This example selects gem explicitly, so it does not depend on the active theme. Use it in R2025a or later for the colors shown above.

x = (0:0.1:2*pi)';
y = sin(x + (0:6)*pi/7);
figure
colororder(orderedcolors("gem"))
plot(x,y,"LineWidth",1.5)
xlabel("x")
ylabel("sin(x + phase)")
grid on
MATLAB Colors swatches: gem 1, gem 2, gem 3, gem 4, gem 5, gem 6, gem 7, Black, White.

Shades

Palettes

No items found.