annotate scripts/plot/__gnuplot_has_feature__.m @ 8890:ae51d068bbd5

__actual_axis_position__.m: New function to determine position of rendered axes.
author Ben Abbott <bpabbott@mac.com>
date Sat, 28 Feb 2009 22:39:33 -0500
parents 665b264b6a50
children 7a7cf569528d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8620
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
1 ## Copyright (C) 2009 Ben Abbott
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
2 ##
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
3 ## This program is free software; you can redistribute it and/or modify
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
4 ## it under the terms of the GNU General Public License as published by
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
5 ## the Free Software Foundation; either version 2 of the License, or
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
6 ## (at your option) any later version.
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
7 ##
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
8 ## This program is distributed in the hope that it will be useful,
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
11 ## GNU General Public License for more details.
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
12 ##
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
13 ## 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
14 ## 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
15 ## <http://www.gnu.org/licenses/>.
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
16
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
17 ## -*- texinfo -*-
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8645
diff changeset
18 ## @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
19 ## Undocumented internal function.
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
20 ## @end deftypefn
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
21
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
22 ## 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
23 ## Created: 2009-01-27
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
24
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
25 function res = __gnuplot_has_feature__ (feature)
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
26 persistent features has_features
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
27 features = {"x11_figure_position",
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
28 "transparent_patches",
8645
579f1f54cc3a Add support for transparent surfaces
Kai Habel
parents: 8620
diff changeset
29 "transparent_surface",
8620
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
30 "epslatex_implies_eps_filesuffix",
8889
665b264b6a50 Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents: 8812
diff changeset
31 "epslatexstandalone_terminal",
665b264b6a50 Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents: 8812
diff changeset
32 "screen_coordinates_for_{lrtb}margin",};
8620
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
33
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
34 if (isempty (has_features))
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
35 gnuplot_version = __gnuplot_version__ ();
8889
665b264b6a50 Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents: 8812
diff changeset
36 versions = {"4.2.4", "4.3", "4.3", "4.2", "4.2", "4.3"};
665b264b6a50 Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents: 8812
diff changeset
37 operators = {">", ">=", ">=", ">=", ">=", ">="};
8620
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
38 have_features = logical (zeros (size (features)));
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
39 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
40 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
41 endfor
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
42 endif
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
43
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
44 n = find (strcmpi (feature, features));
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
45 if (isempty (n))
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
46 res = NaN;
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
47 else
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
48 res = has_features(n);
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
49 endif
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
50 endfunction
a2dd2ffc504d __gnuplot_has_feature__.m: New file, checks for supported feature.
Ben Abbott <bpabbott@mac.com>
parents:
diff changeset
51