Sometimes you have to plot a series of functions on the same axes, but if you
let MATLAB select the colors for you, you’ll get quite a mess:
If you define a colormap over the range you’re working with, you can create a
plot that’s easier to understand:
First you have to create a colormap using a preset you like (a list is
Then you can set the plot colour using the map you’ve created:
You can find the code used to generate both plots at the end of the post.
Enjoy, and remember: friends don’t let friends use jet.
Sample Code Without Colormap:
Sample Code With Colormap: