Mercurial > hg > octave-lyh
annotate scripts/plot/private/__gnuplot_has_feature__.m @ 17129:b5d6314314fc
Change various plot functions to take advantage of new isaxes() function.
* scripts/geometry/voronoi.m, scripts/image/imagesc.m,
scripts/plot/__plt_get_axis_arg__.m, scripts/plot/axes.m, scripts/plot/cla.m,
scripts/plot/colorbar.m, scripts/plot/hold.m, scripts/plot/legend.m,
scripts/plot/plotmatrix.m, scripts/plot/plotyy.m,
scripts/plot/private/__errplot__.m, scripts/plot/private/__plt__.m,
scripts/plot/view.m: Use new isaxes function to simplify code.
* scripts/plot/shading.m: Use Octave convention for spacing of parentheses.
* scripts/plot/zlabel.m: Correct %!test incorrectly calling plot3 with figure
handle.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 31 Jul 2013 16:27:49 -0700 |
parents | 3cce6b4e0f7c |
children |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12793
diff
changeset
|
1 ## Copyright (C) 2009-2012 Ben Abbott |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
2 ## |
11104 | 3 ## This file is part of Octave. |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
8620
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
18 |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8645
diff
changeset
|
20 ## @deftypefn {Function File} {@var{has_feature} =} __gnuplot_has_feature__ (@var{feature}) |
8620
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
21 ## Undocumented internal function. |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
22 ## @end deftypefn |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
23 |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
24 ## Author: Ben Abbott <bpabbott@mac.com> |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
25 ## Created: 2009-01-27 |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
26 |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
27 function res = __gnuplot_has_feature__ (feature) |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
28 persistent features = {"x11_figure_position", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
29 "wxt_figure_size", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
30 "transparent_patches", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
31 "transparent_surface", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
32 "epslatex_implies_eps_filesuffix", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
33 "epslatexstandalone_terminal", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
34 "screen_coordinates_for_{lrtb}margin", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
35 "variable_GPVAL_TERMINALS", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
36 "key_has_font_properties", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
37 "windows_figure_position", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
38 "has_termoption_dashed"}; |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
39 persistent has_features; |
8620
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
40 |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
41 if (isempty (has_features)) |
12325
5d68277d4496
__gnuplot_has_feature__.m: Don't throw an error if gnuplot isn't installed.
Ben Abbott <bpabbott@mac.com>
parents:
11587
diff
changeset
|
42 try |
5d68277d4496
__gnuplot_has_feature__.m: Don't throw an error if gnuplot isn't installed.
Ben Abbott <bpabbott@mac.com>
parents:
11587
diff
changeset
|
43 gnuplot_version = __gnuplot_version__ (); |
5d68277d4496
__gnuplot_has_feature__.m: Don't throw an error if gnuplot isn't installed.
Ben Abbott <bpabbott@mac.com>
parents:
11587
diff
changeset
|
44 catch |
5d68277d4496
__gnuplot_has_feature__.m: Don't throw an error if gnuplot isn't installed.
Ben Abbott <bpabbott@mac.com>
parents:
11587
diff
changeset
|
45 ## Don't throw an error if gnuplot isn't installed |
5d68277d4496
__gnuplot_has_feature__.m: Don't throw an error if gnuplot isn't installed.
Ben Abbott <bpabbott@mac.com>
parents:
11587
diff
changeset
|
46 gnuplot_version = "0.0.0"; |
5d68277d4496
__gnuplot_has_feature__.m: Don't throw an error if gnuplot isn't installed.
Ben Abbott <bpabbott@mac.com>
parents:
11587
diff
changeset
|
47 end_try_catch |
16095
1339c964b527
Fix warning when using "termoption dashed" with gnuplot 4.2.X (bug #38370)
Rik <rik@octave.org>
parents:
14417
diff
changeset
|
48 versions = {"4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4", "4.4", "4.3"}; |
1339c964b527
Fix warning when using "termoption dashed" with gnuplot 4.2.X (bug #38370)
Rik <rik@octave.org>
parents:
14417
diff
changeset
|
49 operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
50 have_features = false (size (features)); |
8620
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
51 for n = 1 : numel (have_features) |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
52 has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n}); |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
53 endfor |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
54 endif |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
55 |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
56 n = find (strcmpi (feature, features)); |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
57 if (isempty (n)) |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
58 res = NaN; |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
59 else |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
60 res = has_features(n); |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
61 endif |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
62 |
8620
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
63 endfunction |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
64 |