More Line Styles in Matlab - Without Markers?
Is There Some Way to Plot More Than 4 Line Styles in Matlab (As It Is Stated Here ), I Mean Line Styles Without Markers? I 'Ve Tried but There Is Some Problem...
Is there some way to plot more than 4 line styles in Matlab (as it is stated here ), I mean line styles without markers?
I 've tried but there is some problem, it does not display line correct in the legend.
Next solution for me is gnuplot, but I have whole calculation in Matlab. Is there any other advice, what other to use or what to do with Matlab to make more than 4 line styles? Will there be more line styles in next Matlab version?
1 Answer
There are only 4 line styles, and realistically that's probably a reasonable limit in terms of legibility. But there are lots of marker styles, why not make your own "lines" by plotting close together markers?
x = 1:0.01:2;
a = sin(x);
b = sin(x) - sort(rand(size(x))/4);
c = sin(x) + sort(rand(size(x))/10);
figure;
hold on
plot( x, a, 'linestyle', 'none', 'marker', 's' );
plot( x, b, 'linestyle', '-', 'marker', 'o' );
plot( x, c, 'linestyle', '-', 'marker', '*', 'linewidth', 1, 'markersize', 5);
You might need to do some interpolation to upsample your data to create the line illusion from close-together markers, interp1 is a simple way to do this.
Although I would echo Cris's comment, your plot will quickly become cluttered, consider using subplots, colours, or other devices to illustrate different series and avoid chart clutter.