MATLAB 'LineOrder' and 'ColorOrder' help

  • Context: MATLAB 
  • Thread starter Thread starter end3r7
  • Start date Start date
  • Tags Tags
    Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 11K views
end3r7
Messages
168
Reaction score
0
For the life of me, I can't figure out how to set the color order and line order to cycle through the graphs of my program.

What I have right now (and I've tried a bunch of different stuff in the past) is

set(gca, 'ColorOrder', [0 0 1; 0 1 0; 1 0 0]);
set(gca,'LineStyleOrder',{'-*',':','o'});

as the first line of my code, but it wont' cycle,a nd I'm currently going insane (just a little).

Any help would be most apprecitaed.
 
Physics news on Phys.org
Please anyone? Also, if possible, I would like to not change the default order for future runs, since the program I'm writing will be used by tohers.
 
You need to change the nextplot settings
set(gca, 'ColorOrder', [0 0 1; 0 1 0; 1 0 0],'LineStyleOrder',{'-*',':','o'},'NextPlot','ReplaceChildren'),
you can change the global settings too, I think 0 instead of gca will do it, but I haven't tried

- J