Posted By

benjamin on 10/29/09


Tagged

style line colour color figure marker linestyle


Versions (?)

line styles, colors, markers in matlab


 / Published in: MatLab
 

URL: http://www.myoutsourcedbrain.com/2009/03/line-styles-in-matlab.html

This script is for generating plots with many curves, where each curve has its own marker, color, and line style. Please see my blog post for more explanations and leave comments there.

  1. linestyles = cellstr(char('-',':','-.','--','-',':','-.','--','-',':','-',':',...
  2. '-.','--','-',':','-.','--','-',':','-.'));
  3.  
  4. MarkerEdgeColors=jet(n); % n is the number of different items you have
  5. Markers=['o','x','+','*','s','d','v','^','<','>','p','h','.',...
  6. '+','*','o','x','^','<','h','.','>','p','s','d','v',...
  7. 'o','x','+','*','s','d','v','^','<','>','p','h','.'];
  8.  
  9. % [...]
  10.  
  11. hold on
  12. for i=1:n
  13. plot(X(i,:), Y(i,:),[linestyles{i} Markers(i)],'Color',MarkerEdgeColors(i,:));
  14. end

Report this snippet  

You need to login to post a comment.