Posted By

benjamin on 10/29/09


style line colour color figure marker linestyle

Versions (?)

line styles, colors, markers in matlab

 / Published in: MatLab


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. '-.','--','-',':','-.','--','-',':','-.'));
  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','.'];
  9. % [...]
  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  


RSS Icon Subscribe to comments
Posted By: liange on June 21, 2011

I am a fresher and want to learn many things. I would like to know how easily we can master in Matlab. SEO Reseller

Posted By: kevinmiller on July 23, 2011

Great post, what you said is really helpful to me. I can not Agree With You Anymore. I Have Been talking with my friend about, he though it is really interesting as well. Keep up your good work With, I would come back to you. Custom Logo Design Website Design brochure designs

You need to login to post a comment.