Mercurial > hg > octave-lyh
annotate scripts/plot/loglog.m @ 10730:390d93e20531
Plot commands now print usage information without errors
when called with no arguments (bug #29986).
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 24 Jun 2010 12:22:27 -0700 |
parents | 153e6226a669 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2004, |
2 ## 2005, 2006, 2007 John W. Eaton | |
2313 | 3 ## |
4 ## This file is part of Octave. | |
5 ## | |
6 ## Octave is free software; you can redistribute it and/or modify it | |
7 ## under the terms of the GNU General Public License as published by | |
7016 | 8 ## the Free Software Foundation; either version 3 of the License, or (at |
9 ## your option) any later version. | |
2313 | 10 ## |
11 ## Octave is distributed in the hope that it will be useful, but | |
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 ## General Public License for more details. | |
15 ## | |
16 ## You should have received a copy of the GNU General Public License | |
7016 | 17 ## along with Octave; see the file COPYING. If not, see |
18 ## <http://www.gnu.org/licenses/>. | |
245 | 19 |
3368 | 20 ## -*- texinfo -*- |
10730
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
21 ## @deftypefn {Function File} {} loglog (@var{y}) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
22 ## @deftypefnx {Function File} {} loglog (@var{x}, @var{y}) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
23 ## @deftypefnx {Function File} {} loglog (@var{x}, @var{y}, @var{property}, @var{value}, @dots{}) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
24 ## @deftypefnx {Function File} {} loglog (@var{x}, @var{y}, @var{fmt}) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
25 ## @deftypefnx {Function File} {} loglog (@var{h}, @dots{}) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
26 ## @deftypefnx {Function File} {@var{h} =} loglog (@dots{}) |
6895 | 27 ## Produce a two-dimensional plot using log scales for both axes. See |
10730
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
28 ## the documentation of @code{plot} for a description of the arguments |
6895 | 29 ## that @code{loglog} will accept. |
30 ## @seealso{plot, semilogx, semilogy} | |
3368 | 31 ## @end deftypefn |
4 | 32 |
2314 | 33 ## Author: jwe |
34 | |
6302 | 35 function retval = loglog (varargin) |
4 | 36 |
10730
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
37 [h, varargin, nargs] = __plt_get_axis_arg__ ("loglog", varargin{:}); |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
38 |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
39 if (nargs < 1) |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
40 print_usage(); |
390d93e20531
Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents:
10511
diff
changeset
|
41 endif |
7216 | 42 |
7207 | 43 oldh = gca (); |
44 unwind_protect | |
45 axes (h); | |
46 newplot (); | |
3063 | 47 |
7207 | 48 set (h, "xscale", "log", "yscale", "log"); |
10511
153e6226a669
loglog.m: Minor ticks on by default for loglog plots.
Ben Abbott <bpabbott@mac.com>
parents:
7216
diff
changeset
|
49 if (any( strcmp (get (gca, "nextplot"), {"new", "replace"}))) |
153e6226a669
loglog.m: Minor ticks on by default for loglog plots.
Ben Abbott <bpabbott@mac.com>
parents:
7216
diff
changeset
|
50 set (h, "xminortick", "on", "yminortick", "on"); |
153e6226a669
loglog.m: Minor ticks on by default for loglog plots.
Ben Abbott <bpabbott@mac.com>
parents:
7216
diff
changeset
|
51 endif |
4 | 52 |
7207 | 53 tmp = __plt__ ("loglog", h, varargin{:}); |
6302 | 54 |
7207 | 55 if (nargout > 0) |
56 retval = tmp; | |
57 endif | |
58 unwind_protect_cleanup | |
59 axes (oldh); | |
60 end_unwind_protect | |
4 | 61 |
62 endfunction | |
10511
153e6226a669
loglog.m: Minor ticks on by default for loglog plots.
Ben Abbott <bpabbott@mac.com>
parents:
7216
diff
changeset
|
63 |