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.

Contribute
DelftStack is a collective effort contributed by software geeks like you. If you like the article and would like to contribute to DelftStack by writing paid articles, you can check the write for us page.

Related Article - MATLAB Plot

  • MATLAB Axis Limits
  • MATLAB RGB Triplet