MATLAB Default Color Order
Ammar Ali
May 05, 2021
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