We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


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=['r','c','b','k','g','m','y',...
  5. 'b','m','k','c','g','r','b','m','k','c','g',...
  6. 'r','c','b','k','g','m','r','b','m','k','c','g','r'];
  7. Markers=['o','x','+','*','s','d','v','^','<','>','p','h','.',...
  8. '+','*','o','x','^','<','h','.','>','p','s','d','v',...
  9. 'o','x','+','*','s','d','v','^','<','>','p','h','.'];
  10.  
  11. % [...]
  12.  
  13. hold on
  14. for i=1:n
  15. plot(X(i,:), Y(i,:),[linestyles{i} Markers(i) MarkerEdgeColors(i)]);
  16. end

Report this snippet 

You need to login to post a comment.