Code covered by the BSD License  

Highlights from
LPLOT

5.0

5.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 2.19 KB File ID: #7218
image thumbnail

LPLOT

by Jiro Doke

 

22 Mar 2005 (Updated 07 Jan 2010)

PLOT command that cycles through line styles.

| Watch this File

File Information
Description

LPLOT(X,Y) plots Y versus X just like the PLOT command but cycles through 12 different line styles instead of colors (4 line styles x 3 line widths). The axes LineStyleOrder is set to '-|:|--|-.' and axes ColorOrder is set to [0 0 0]. Multiple data sets, accepted by PLOT, are allowed. e.g. LPLOT(X1, Y1, X2, Y2, ...) or LPLOT(X, [Y1, Y2, ...])

H = LPLOT(...) returns a vector of line handles.

Example:
  x = (0:0.1:10)';

  y1 = 1.2 * sin(x);
  y2 = 0.7 * cos(0.3 * x);
  y3 = 2 * sin(0.7 * x);
  y4 = y1 + y2;
  y5 = y1 + y3;
  y6 = y2 + y3;
  y7 = y1 - y2;
  y8 = y1 - y3;
  y9 = y3 - y2;
  y10 = y1 .* y2;
  y11 = y1 .* y3;
  y12 = y2 .* y3;

  h = lplot(x, [y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12]);
  legend(h, ...
    'y1','y2','y3','y4','y5','y6','y7','y8','y9','y10','y11','y12', ...
    'Location', 'EastOutside');

MATLAB release MATLAB 7.9 (2009b)
Other requirements Also tested on R14
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
18 Apr 2005 K Morton

Exactly what I wanted. Works great.

Please login to add a comment or rating.
Updates
06 Mar 2006

Removed optional LineStyleOrder option. Reset properties afterwards.

06 Mar 2006

Minor code fix.

30 Dec 2009

allow all numeric input arguments accepted by PLOT. more line types (12).

07 Jan 2010

Allow all numeric input arguments accepted by PLOT. Added more line types (12). Updated copyright.

Tag Activity for this File
Tag Applied By Date/Time
specialized Jiro Doke 22 Oct 2008 07:43:54
plotting Jiro Doke 22 Oct 2008 07:43:54
plot Jiro Doke 22 Oct 2008 07:43:54
line styles Jiro Doke 22 Oct 2008 07:43:54
monochrome Jiro Doke 22 Oct 2008 07:43:54
graphics Jiro Doke 22 Oct 2008 07:43:54

Contact us at files@mathworks.com