Mercurial > hg > octave-nkf
annotate scripts/plot/isaxes.m @ 17525:76a6d7de4cbc
Fix multiple problem with listeners for contour groups.
* scripts/plot/contour.m: Add new %!demo showing use of a single contour line.
* scripts/plot/private/__contour__.m: Fix bug with lowest level of contourf
showing background through. Use same routines for calculating levels and
levelstep in main code and in listeners. Fix linecolor when turning "fill" on
and off. Fix "textlist" and "textliststep" properties which were not
activating correctly.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 01 Oct 2013 12:51:04 -0700 |
parents | bcada0a4f8a7 |
children |
rev | line source |
---|---|
17123
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
1 ## Copyright (C) 2013 Rik Wehbring |
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 ## |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
23 ## If @var{h} is a matrix then return a logical array which is true where |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
24 ## the elements of @var{h} are axes graphics handles and false where |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
25 ## they are not. |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
26 ## @seealso{isaxes, ishandle} |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
27 ## @end deftypefn |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
28 |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
29 ## Author: jwe |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
30 |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
31 function retval = isaxes (h) |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
32 |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
33 if (nargin != 1) |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
34 print_usage (); |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
35 endif |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
36 |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
37 hlist = ishandle (h); |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
38 if (any (hlist)) |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
39 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
|
40 else |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
41 retval = hlist; |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
42 endif |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
43 |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
44 endfunction |
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 |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
47 %!test |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
48 %! hf = figure ("visible", "off"); |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
49 %! unwind_protect |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
50 %! hax = axes (); |
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 %! assert (! isaxes (-hax)); |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
53 %! unwind_protect_cleanup |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
54 %! close (hf); |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
55 %! end_unwind_protect |
bcada0a4f8a7
isaxes.m: New function to determine if object is axes handle.
Rik <rik@octave.org>
parents:
diff
changeset
|
56 |