Mercurial > octave
annotate scripts/plot/util/private/__gnuplot_has_feature__.m @ 21278:48d82f74243e
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 16 Feb 2016 23:34:44 -0500 |
parents | c7d881aec36c 8990b8c4f00a |
children | 21c3641422e0 |
rev | line source |
---|---|
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
1 ## Copyright (C) 2009-2015 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 -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20289
diff
changeset
|
20 ## @deftypefn {} {@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) |
20289
13ede127ec9a
graphics_toolkit.m: Check for minimum gnuplot version (bug #44978).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
28 persistent features = {"minimum_version", |
13ede127ec9a
graphics_toolkit.m: Check for minimum gnuplot version (bug #44978).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
29 "x11_figure_position", |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
30 "wxt_figure_size", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
31 "transparent_patches", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
32 "transparent_surface", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
33 "epslatex_implies_eps_filesuffix", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
34 "epslatexstandalone_terminal", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
35 "screen_coordinates_for_{lrtb}margin", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
36 "variable_GPVAL_TERMINALS", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
37 "key_has_font_properties", |
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
38 "windows_figure_position", |
21263
8990b8c4f00a
For gnuplot 5.x, add the "color" option to the postscript terminal.
Ben Abbott <bpabbott@mac.com>
parents:
19697
diff
changeset
|
39 "has_termoption_dashed", |
8990b8c4f00a
For gnuplot 5.x, add the "color" option to the postscript terminal.
Ben Abbott <bpabbott@mac.com>
parents:
19697
diff
changeset
|
40 "needs_color_with_postscript"}; |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
41 persistent has_features; |
8620
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
42 |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
43 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
|
44 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
|
45 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
|
46 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
|
47 ## 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
|
48 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
|
49 end_try_catch |
20883
c7d881aec36c
For gnuplot 5.x, add the "color" option to the postscript terminal.
Ben Abbott <bpabbott@mac.com>
parents:
20852
diff
changeset
|
50 versions = {"4.2.5", "4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4", "4.4", "4.3", "5.0"}; |
c7d881aec36c
For gnuplot 5.x, add the "color" option to the postscript terminal.
Ben Abbott <bpabbott@mac.com>
parents:
20852
diff
changeset
|
51 operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
52 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
|
53 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
|
54 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
|
55 endfor |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
56 endif |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
57 |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
58 n = find (strcmpi (feature, features)); |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
59 if (isempty (n)) |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
60 res = NaN; |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
61 else |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
62 res = has_features(n); |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
63 endif |
16108
3cce6b4e0f7c
Update gnuplot plotting scripts for faster or more modern synta
Rik <rik@octave.org>
parents:
16095
diff
changeset
|
64 |
8620
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
65 endfunction |
a2dd2ffc504d
__gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff
changeset
|
66 |