comparison scripts/plot/legend.m @ 6395:a8dd70bacc1e

[project @ 2007-03-07 22:22:12 by jwe]
author jwe
date Wed, 07 Mar 2007 22:24:22 +0000
parents a1f3d3b7ee5c
children 98ee80702bca
comparison
equal deleted inserted replaced
6394:df3445687c6e 6395:a8dd70bacc1e
27 ## Be sure to call plot before calling legend. 27 ## Be sure to call plot before calling legend.
28 ## 28 ##
29 ## @var{pos} optionally places the legend in the specified location: 29 ## @var{pos} optionally places the legend in the specified location:
30 ## 30 ##
31 ## @multitable @columnfractions 0.1 0.1 0.8 31 ## @multitable @columnfractions 0.1 0.1 0.8
32 ## @item @tab -1 @tab
33 ## To the top right of the plot
32 ## @item @tab 0 @tab 34 ## @item @tab 0 @tab
33 ## Don't move the legend box (default) 35 ## Don't move the legend box (default)
34 ## @item @tab 1 @tab 36 ## @item @tab 1 @tab
35 ## Upper right-hand corner 37 ## Upper right-hand corner
36 ## @item @tab 2 @tab 38 ## @item @tab 2 @tab
37 ## Upper left-hand corner 39 ## Upper left-hand corner
38 ## @item @tab 3 @tab 40 ## @item @tab 3 @tab
39 ## Lower left-hand corner 41 ## Lower left-hand corner
40 ## @item @tab 4 @tab 42 ## @item @tab 4 @tab
41 ## Lower right-hand corner 43 ## Lower right-hand corner
42 ## @item @tab -1 @tab
43 ## To the top right of the plot
44 ## @item @tab -2 @tab
45 ## To the bottom right of the plot
46 ## @item @tab -3 @tab
47 ## To the bottom of the plot
48 ## @item @tab [@var{x}, @var{y}] @tab
49 ## To the arbitrary postion in plot [@var{x}, @var{y}]
50 ## @end multitable 44 ## @end multitable
51 ## 45 ##
52 ## Some specific functions are directely avaliable using @var{func}: 46 ## Some specific functions are directely avaliable using @var{func}:
53 ## 47 ##
54 ## @table @code 48 ## @table @code
77 ca = gca (); 71 ca = gca ();
78 72
79 if (nargs > 0) 73 if (nargs > 0)
80 pos = varargin{nargs}; 74 pos = varargin{nargs};
81 if (isnumeric (pos) && isscalar (pos) && round (pos) == pos) 75 if (isnumeric (pos) && isscalar (pos) && round (pos) == pos)
82 if (pos >= -3 && pos <= 4) 76 if (pos >= -1 && pos <= 4)
83 set (ca, "keypos", pos); 77 set (ca, "keypos", pos);
84 nargs--; 78 nargs--;
85 else 79 else
86 error ("legend: invalid position specified"); 80 error ("legend: invalid position specified");
87 endif 81 endif