Change underlying colormap for 'plot', just like in 'area'

110 views (last 30 days)
I'm trying to have a figure with various subplots, showing portfolio composition with area plots and portfolio returns with a normal (line) plots. For the area plot, Matlab is using the default colormap Jet, and I can change this by using
colormap(summer)
for example. Now it makes sense to plot the time series of returns of each assets in the same color as it has in the area plot, however, Matlab always uses the 'line' colormap, which has the problem that it repeats itself after the seventh color, making curves 8 and 9 blue and green like curves 1 and 2. typing colormap(summer), as above, does affect the 'area' command, but not the 'plot' command. I'm working with many subplots, hence a solution that does not have to be applied to every single plot would be best.

Accepted Answer

the cyclist
the cyclist on 8 Aug 2013
Edited: the cyclist on 8 Aug 2013
  4 Comments
Max
Max on 9 Aug 2013
I now got it, it was necessary to type the command
set(0,'DefaultAxesColorOrder',summer(9))'
where '9' is the number of colors that the colormap should have.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by