annotate scripts/plot/util/isaxes.m @ 20602:af5591ef9790 stable

__gnuplot_drawnow__.m: Use "screenpixelsperinch" instead of constant value (bug #46122).
author ederag <edera@gmx.fr>
date Tue, 06 Oct 2015 11:07:10 +0200
parents 777f26aa8e3e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 18788
diff changeset
1 ## Copyright (C) 2013-2015 Rik Wehbring
17123
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
2 ##
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
3 ## This file is part of Octave.
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
4 ##
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
8 ## your option) any later version.
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
9 ##
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
13 ## General Public License for more details.
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
14 ##
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
18
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
19 ## -*- texinfo -*-
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
20 ## @deftypefn {Function File} {} isaxes (@var{h})
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
21 ## Return true if @var{h} is an axes graphics handle and false otherwise.
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
22 ##
20208
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
23 ## If @var{h} is a matrix then return a logical array which is true where the
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
24 ## elements of @var{h} are axes graphics handles and false where they are not.
17123
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
25 ## @seealso{isaxes, ishandle}
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
26 ## @end deftypefn
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
27
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
28 ## Author: jwe
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
29
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
30 function retval = isaxes (h)
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
31
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
32 if (nargin != 1)
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
33 print_usage ();
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
34 endif
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
35
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
36 hlist = ishandle (h);
18788
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
37 retval = hlist;
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
38
17123
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
39 if (any (hlist))
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
40 retval(hlist) = strcmp (get (h(hlist), "type"), "axes");
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
41 endif
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
42
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
43 endfunction
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
44
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
45
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
46 %!test
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
47 %! hf = figure ("visible", "off");
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
48 %! unwind_protect
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
49 %! hax = axes ();
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
50 %! assert (isaxes (hax));
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
51 %! assert (! isaxes (-hax));
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
52 %! unwind_protect_cleanup
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
53 %! close (hf);
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
54 %! end_unwind_protect
bcada0a4f8a7 isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff changeset
55
18788
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
56 %!test
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
57 %! hf = figure ("visible", "off");
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
58 %! unwind_protect
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
59 %! hax = axes ();
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
60 %! assert (isaxes ([hax NaN]), [true false]);
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
61 %! unwind_protect_cleanup
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
62 %! close (hf);
4ca40b289b2c isaxes.m: Fix bug where some inputs do not show up in outputs (bug #42362).
Stefan Mahr <dac922@gmx.de>
parents: 17572
diff changeset
63 %! end_unwind_protect