MATLAB Default Color Order

Ammar Ali May 05, 2021
MATLAB Default Color Order

This tutorial will discuss how to get the default color order using the get() function in MATLAB.

Default Color Order in MATLAB

The default color order in MATLAB varies depending on the Matlab version. To get the color order for your MATLAB version, you can use the get() function to get the color order in RGB. See the example code below.

color_order = get(gca,'colororder')

Using the above code, you will see RGB triplet values of the default color order, and you can also plot a line using these RGB values to check the color. The color order means that if you plot one variable, MATLAB will give it a default color which will be the first RGB triplet value you get using the get() function. If the plots exceed the limit of the color order, the color will be repeated.

Author: Ammar Ali
Ammar Ali avatar Ammar Ali avatar

Hello! I am Ammar Ali, a programmer here to learn from experience, people, and docs, and create interesting and useful programming content. I mostly create content about Python, Matlab, and Microcontrollers like Arduino and PIC.

LinkedIn Facebook

Related Article - MATLAB Plot