Mercurial > hg > octave-nkf
annotate scripts/plot/__go_draw_axes__.m @ 11109:41d18f6342f9
remove image_viewer function
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 18 Oct 2010 14:15:06 -0400 |
parents | d4619eb6ef8e |
children | a981e2f56ec1 |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2005, 2007, 2008, 2009 John W. Eaton |
6405 | 2 ## |
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 | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
6405 | 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 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
6405 | 18 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8740
diff
changeset
|
19 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8740
diff
changeset
|
20 ## @deftypefn {Function File} {} __go_draw_axes__ (@var{h}, @var{plot_stream}, @var{enhanced}, @var{mono}) |
6895 | 21 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8740
diff
changeset
|
22 ## @end deftypefn |
6405 | 23 |
24 ## Author: jwe | |
25 | |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
26 function __go_draw_axes__ (h, plot_stream, enhanced, mono, bg_is_set, hlegend) |
6405 | 27 |
10528
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
28 if (nargin >= 4 && nargin <= 6) |
6405 | 29 |
8894
4414e555505d
__go_draw_axes__.m: Do not render axis labels twice when their handles are visible.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
30 showhiddenhandles = get (0, "showhiddenhandles"); |
4414e555505d
__go_draw_axes__.m: Do not render axis labels twice when their handles are visible.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
31 unwind_protect |
4414e555505d
__go_draw_axes__.m: Do not render axis labels twice when their handles are visible.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
32 set (0, "showhiddenhandles", "on"); |
4414e555505d
__go_draw_axes__.m: Do not render axis labels twice when their handles are visible.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
33 axis_obj = __get__ (h); |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
34 if (isempty (hlegend)) |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
35 hlgnd = []; |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
36 else |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
37 hlgnd = __get__ (hlegend); |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
38 endif |
8894
4414e555505d
__go_draw_axes__.m: Do not render axis labels twice when their handles are visible.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
39 unwind_protect_cleanup |
4414e555505d
__go_draw_axes__.m: Do not render axis labels twice when their handles are visible.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
40 set (0, "showhiddenhandles", showhiddenhandles); |
4414e555505d
__go_draw_axes__.m: Do not render axis labels twice when their handles are visible.
Ben Abbott <bpabbott@mac.com>
parents:
8889
diff
changeset
|
41 end_unwind_protect |
6405 | 42 |
43 parent_figure_obj = get (axis_obj.parent); | |
9257
ab952265ad06
__go_draw_axes__.m: Properly render TeX symbols for x11.
Ben Abbott <bpabbott@mac.com>
parents:
9191
diff
changeset
|
44 gnuplot_term = __gnuplot_get_var__ (axis_obj.parent, "GPVAL_TERM"); |
6405 | 45 |
8208 | 46 ## Set to false for plotyy axes. |
47 if (strcmp (axis_obj.tag, "plotyy")) | |
8102 | 48 ymirror = false; |
8208 | 49 else |
50 ymirror = true; | |
7189 | 51 endif |
52 | |
10917
888c75785221
Improvements to FLTK backend rotation
Jordi Guti?rrez Hermoso <jordigh@gmail.com>
parents:
10913
diff
changeset
|
53 nd = __calc_dimensions__ (h); |
888c75785221
Improvements to FLTK backend rotation
Jordi Guti?rrez Hermoso <jordigh@gmail.com>
parents:
10913
diff
changeset
|
54 |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
55 if (strcmp (axis_obj.dataaspectratiomode, "manual") |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
56 && strcmp (axis_obj.xlimmode, "manual") |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
57 && strcmp (axis_obj.ylimmode, "manual")) |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
58 ## All can't be "manual" |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
59 axis_obj.plotboxaspectratiomode = "auto"; |
10532
568c7c041fac
colorbar.m: Consistent treatment of plotboxaspectratio. Add listener for plotboxaspectratiomode.
Ben Abbott <bpabbott@mac.com>
parents:
10528
diff
changeset
|
60 endif |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
61 |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
62 if (strcmp (axis_obj.dataaspectratiomode, "manual") |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
63 && strcmp (axis_obj.xlimmode, "manual") |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
64 && strcmp (axis_obj.ylimmode, "manual") |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
65 && (nd == 2 || all (mod (axis_obj.view, 90) == 0))) |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
66 ## FIXME - adjust plotboxaspectratio to respect other |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
67 fpos = get (axis_obj.parent, "position"); |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
68 apos = axis_obj.position; |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
69 endif |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
70 |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
71 pos = __actual_axis_position__ (h); |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
72 |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
73 if (strcmpi (axis_obj.dataaspectratiomode, "manual")) |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
74 dr = axis_obj.dataaspectratio; |
10910
40cf7cc4ea62
Properly interpret plotboxaspectratio when 3D objects are viewed as 2D.
Ben Abbott <bpabbott@mac.com>
parents:
10635
diff
changeset
|
75 if (nd == 2 || all (mod (axis_obj.view, 90) == 0)) |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
76 dr = dr(1) / dr(2); |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
77 else |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
78 ## FIXME - need to properly implement 3D |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
79 dr = mean (dr(1:2)) / dr(3); |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
80 endif |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
81 else |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
82 dr = 1; |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
83 endif |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
84 |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
85 if (strcmp (axis_obj.activepositionproperty, "position")) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
86 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
87 if (nd == 2 || all (mod (axis_obj.view, 90) == 0)) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
88 x = [1, 1]; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
89 else |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
90 ## 3D plots need to be sized down to fit in the window. |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
91 x = 1.0 ./ sqrt([2, 2.5]); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
92 endif |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
93 fprintf (plot_stream, "set tmargin screen %.15g;\n", |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
94 pos(2)+pos(4)/2+x(2)*pos(4)/2); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
95 fprintf (plot_stream, "set bmargin screen %.15g;\n", |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
96 pos(2)+pos(4)/2-x(2)*pos(4)/2); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
97 fprintf (plot_stream, "set lmargin screen %.15g;\n", |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
98 pos(1)+pos(3)/2-x(1)*pos(3)/2); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
99 fprintf (plot_stream, "set rmargin screen %.15g;\n", |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
100 pos(1)+pos(3)/2+x(1)*pos(3)/2); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
101 sz_str = ""; |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
102 else |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
103 fprintf (plot_stream, "set tmargin 0;\n"); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
104 fprintf (plot_stream, "set bmargin 0;\n"); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
105 fprintf (plot_stream, "set lmargin 0;\n"); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
106 fprintf (plot_stream, "set rmargin 0;\n"); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
107 |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
108 if (nd == 3 && all (axis_obj.view == [0, 90])) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
109 ## FIXME -- Kludge to allow colorbar to be added to a pcolor() plot |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
110 pos(3:4) = pos(3:4) * 1.4; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
111 pos(1:2) = pos(1:2) - pos(3:4) * 0.125; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
112 endif |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
113 |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
114 fprintf (plot_stream, "set origin %.15g, %.15g;\n", pos(1), pos(2)); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
115 |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
116 if (strcmpi (axis_obj.dataaspectratiomode, "manual")) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
117 sz_str = sprintf ("set size ratio %.15g", -dr); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
118 else |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
119 sz_str = "set size noratio"; |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
120 endif |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
121 sz_str = sprintf ("%s %.15g, %.15g;\n", sz_str, pos(3), pos(4)); |
10953
9c0b366583cb
Revert treatment of activepositionproperty from the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
10949
diff
changeset
|
122 endif |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
123 else ## activepositionproperty == outerposition |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
124 fprintf (plot_stream, "set origin %g, %g;\n", pos(1:2)) |
10953
9c0b366583cb
Revert treatment of activepositionproperty from the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
10949
diff
changeset
|
125 sz_str = ""; |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
126 if (strcmpi (axis_obj.dataaspectratiomode, "manual")) |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
127 sz_str = sprintf ("ratio %g", -dr); |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
128 else |
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
129 sz_str = "noratio"; |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
130 endif |
11001
2ab8cc6dcced
Special treatment activepositionproperty = outerposition for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10997
diff
changeset
|
131 sz_str = sprintf ("set size %s %g, %g;\n", sz_str, pos(3:4)); |
10931
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
132 endif |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
133 if (! isempty (sz_str)) |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
134 fputs (plot_stream, sz_str); |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
135 endif |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
136 |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
137 if (strcmp (axis_obj.plotboxaspectratiomode, "manual") |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
138 && strcmp (axis_obj.dataaspectratiomode, "manual")) |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
139 if (nd == 2 || all (mod (axis_obj.view, 90) == 0)) |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
140 dy = diff (axis_obj.ylim); |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
141 dx = diff (axis_obj.xlim); |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
142 ar = dx / dy; |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
143 if (ar > dr) |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
144 axis_obj.ylim = mean (axis_obj.ylim) + (ar/dr) * dy * [-1, 1] / 2; |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
145 elseif (ar < dr) |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
146 axis_obj.xlim = mean (axis_obj.xlim) + (dr/ar) * dx * [-1, 1] / 2; |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
147 endif |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
148 else |
a72d53df4fa6
Treatment of activepositionproperty for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
10930
diff
changeset
|
149 ## FIXME - need to implement 3D |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
150 endif |
6405 | 151 endif |
152 | |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
153 ## Reset all labels, axis-labels, tick-labels, and title |
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
154 ## FIXME - We should have an function to initialize the axis. |
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
155 ## Presently, this is dispersed in this function. |
6778 | 156 fputs (plot_stream, "unset label;\n"); |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
157 fputs (plot_stream, "unset xtics;\n"); |
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
158 fputs (plot_stream, "unset ytics;\n"); |
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
159 fputs (plot_stream, "unset ztics;\n"); |
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
160 fputs (plot_stream, "unset x2tics;\n"); |
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
161 fputs (plot_stream, "unset x2tics;\n"); |
6778 | 162 |
6405 | 163 if (! isempty (axis_obj.title)) |
164 t = get (axis_obj.title); | |
165 if (isempty (t.string)) | |
10549 | 166 fputs (plot_stream, "unset title;\n"); |
6405 | 167 else |
10549 | 168 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
169 fontspec = create_fontspec (f, s, gnuplot_term); | |
170 fprintf (plot_stream, "set title \"%s\" %s %s", | |
171 undo_string_escapes (tt), fontspec, | |
172 __do_enhanced_option__ (enhanced, t)); | |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10912
diff
changeset
|
173 if (nd == 3 |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10912
diff
changeset
|
174 && __gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) |
10549 | 175 fprintf (plot_stream, " offset screen 0, screen %.3f;\n", pos(4)/5); |
176 else | |
177 fprintf (plot_stream, ";\n"); | |
178 endif | |
6405 | 179 endif |
180 endif | |
181 | |
182 if (! isempty (axis_obj.xlabel)) | |
183 t = get (axis_obj.xlabel); | |
6737 | 184 angle = t.rotation; |
7269 | 185 colorspec = get_text_colorspec (axis_obj.xcolor, mono); |
6405 | 186 if (isempty (t.string)) |
10549 | 187 fprintf (plot_stream, "unset xlabel;\n"); |
188 fprintf (plot_stream, "unset x2label;\n"); | |
6405 | 189 else |
10549 | 190 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
191 fontspec = create_fontspec (f, s, gnuplot_term); | |
192 if (strcmpi (axis_obj.xaxislocation, "top")) | |
193 fprintf (plot_stream, "set x2label \"%s\" %s %s %s", | |
194 undo_string_escapes (tt), colorspec, fontspec, | |
195 __do_enhanced_option__ (enhanced, t)); | |
196 else | |
197 fprintf (plot_stream, "set xlabel \"%s\" %s %s %s", | |
198 undo_string_escapes (tt), colorspec, fontspec, | |
199 __do_enhanced_option__ (enhanced, t)); | |
200 endif | |
201 fprintf (plot_stream, " rotate by %f;\n", angle); | |
202 if (strcmpi (axis_obj.xaxislocation, "top")) | |
203 fprintf (plot_stream, "unset xlabel;\n"); | |
204 else | |
205 fprintf (plot_stream, "unset x2label;\n"); | |
206 endif | |
6405 | 207 endif |
208 endif | |
209 | |
210 if (! isempty (axis_obj.ylabel)) | |
211 t = get (axis_obj.ylabel); | |
6737 | 212 angle = t.rotation; |
7269 | 213 colorspec = get_text_colorspec (axis_obj.ycolor, mono); |
6405 | 214 if (isempty (t.string)) |
10549 | 215 fprintf (plot_stream, "unset ylabel;\n"); |
216 fprintf (plot_stream, "unset y2label;\n"); | |
6405 | 217 else |
10549 | 218 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
219 fontspec = create_fontspec (f, s, gnuplot_term); | |
220 if (strcmpi (axis_obj.yaxislocation, "right")) | |
221 fprintf (plot_stream, "set y2label \"%s\" %s %s %s", | |
222 undo_string_escapes (tt), colorspec, fontspec, | |
223 __do_enhanced_option__ (enhanced, t)); | |
224 else | |
225 fprintf (plot_stream, "set ylabel \"%s\" %s %s %s", | |
226 undo_string_escapes (tt), colorspec, fontspec, | |
227 __do_enhanced_option__ (enhanced, t)); | |
228 endif | |
229 fprintf (plot_stream, " rotate by %f;\n", angle); | |
230 if (strcmpi (axis_obj.yaxislocation, "right")) | |
231 fprintf (plot_stream, "unset ylabel;\n"); | |
232 else | |
233 fprintf (plot_stream, "unset y2label;\n"); | |
234 endif | |
6405 | 235 endif |
236 endif | |
237 | |
238 if (! isempty (axis_obj.zlabel)) | |
239 t = get (axis_obj.zlabel); | |
6737 | 240 angle = t.rotation; |
7269 | 241 colorspec = get_text_colorspec (axis_obj.zcolor, mono); |
6405 | 242 if (isempty (t.string)) |
10549 | 243 fputs (plot_stream, "unset zlabel;\n"); |
6405 | 244 else |
10549 | 245 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
246 fontspec = create_fontspec (f, s, gnuplot_term); | |
247 fprintf (plot_stream, "set zlabel \"%s\" %s %s %s", | |
248 undo_string_escapes (tt), colorspec, fontspec, | |
249 __do_enhanced_option__ (enhanced, t)); | |
250 fprintf (plot_stream, " rotate by %f;\n", angle); | |
6405 | 251 endif |
252 endif | |
253 | |
6809 | 254 if (strcmpi (axis_obj.xaxislocation, "top")) |
255 xaxisloc = "x2"; | |
256 xaxisloc_using = "x2"; | |
257 else | |
258 xaxisloc = "x"; | |
259 xaxisloc_using = "x1"; | |
7321 | 260 if (strcmpi (axis_obj.xaxislocation, "zero")) |
10549 | 261 fputs (plot_stream, "set xzeroaxis;\n"); |
7321 | 262 endif |
6809 | 263 endif |
264 if (strcmpi (axis_obj.yaxislocation, "right")) | |
265 yaxisloc = "y2"; | |
266 yaxisloc_using = "y2"; | |
267 else | |
268 yaxisloc = "y"; | |
269 yaxisloc_using = "y1"; | |
7321 | 270 if (strcmpi (axis_obj.yaxislocation, "zero")) |
10549 | 271 fputs (plot_stream, "set yzeroaxis;\n"); |
7321 | 272 endif |
6809 | 273 endif |
274 | |
7274 | 275 have_grid = false; |
276 | |
6758 | 277 if (strcmpi (axis_obj.xgrid, "on")) |
7274 | 278 have_grid = true; |
6809 | 279 fprintf (plot_stream, "set grid %stics;\n", xaxisloc); |
6405 | 280 else |
6809 | 281 fprintf (plot_stream, "set grid no%stics;\n", xaxisloc); |
6405 | 282 endif |
283 | |
6758 | 284 if (strcmpi (axis_obj.ygrid, "on")) |
7274 | 285 have_grid = true; |
6809 | 286 fprintf (plot_stream, "set grid %stics;\n", yaxisloc); |
6405 | 287 else |
6809 | 288 fprintf (plot_stream, "set grid no%stics;\n", yaxisloc); |
6405 | 289 endif |
290 | |
6758 | 291 if (strcmpi (axis_obj.zgrid, "on")) |
7274 | 292 have_grid = true; |
6405 | 293 fputs (plot_stream, "set grid ztics;\n"); |
294 else | |
7085 | 295 fputs (plot_stream, "set grid noztics;\n"); |
6405 | 296 endif |
297 | |
6758 | 298 if (strcmpi (axis_obj.xminorgrid, "on")) |
7274 | 299 have_grid = true; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
300 if (strcmp (axis_obj.xscale, "log")) |
10549 | 301 m = 10; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
302 else |
10549 | 303 m = 5; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
304 endif |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
305 fprintf (plot_stream, "set m%stics %d;\n", xaxisloc, m); |
6809 | 306 fprintf (plot_stream, "set grid m%stics;\n", xaxisloc); |
6405 | 307 else |
6809 | 308 fprintf (plot_stream, "set grid nom%stics;\n", xaxisloc); |
6405 | 309 endif |
310 | |
6758 | 311 if (strcmpi (axis_obj.yminorgrid, "on")) |
7274 | 312 have_grid = true; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
313 if (strcmp (axis_obj.yscale, "log")) |
10549 | 314 m = 10; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
315 else |
10549 | 316 m = 5; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
317 endif |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
318 fprintf (plot_stream, "set m%stics %d;\n", yaxisloc, m); |
6809 | 319 fprintf (plot_stream, "set grid m%stics;\n", yaxisloc); |
6405 | 320 else |
6809 | 321 fprintf (plot_stream, "set grid nom%stics;\n", yaxisloc); |
6405 | 322 endif |
323 | |
6758 | 324 if (strcmpi (axis_obj.zminorgrid, "on")) |
7274 | 325 have_grid = true; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
326 if (strcmp (axis_obj.zscale, "log")) |
10549 | 327 m = 10; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
328 else |
10549 | 329 m = 5; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
330 endif |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
331 fprintf (plot_stream, "set mztics %d;\n", m); |
6405 | 332 fputs (plot_stream, "set grid mztics;\n"); |
333 else | |
334 fputs (plot_stream, "set grid nomztics;\n"); | |
335 endif | |
336 | |
7307 | 337 ## The grid front/back/layerdefault option also controls the |
338 ## appearance of tics, so it is used even if the grid is absent. | |
339 if (strcmpi (axis_obj.layer, "top")) | |
340 fputs (plot_stream, "set grid front;\n"); | |
9438
bac81ac76a57
__go_draw_axes__.m: also use layer property for plot border
John W. Eaton <jwe@octave.org>
parents:
9374
diff
changeset
|
341 fputs (plot_stream, "set border front;\n"); |
7307 | 342 else |
343 fputs (plot_stream, "set grid layerdefault;\n"); | |
9438
bac81ac76a57
__go_draw_axes__.m: also use layer property for plot border
John W. Eaton <jwe@octave.org>
parents:
9374
diff
changeset
|
344 ## FIXME -- the gnuplot help says that "layerdefault" should work |
bac81ac76a57
__go_draw_axes__.m: also use layer property for plot border
John W. Eaton <jwe@octave.org>
parents:
9374
diff
changeset
|
345 ## for set border too, but it fails for me with gnuplot 4.2.5. So |
bac81ac76a57
__go_draw_axes__.m: also use layer property for plot border
John W. Eaton <jwe@octave.org>
parents:
9374
diff
changeset
|
346 ## use "back" instead. |
bac81ac76a57
__go_draw_axes__.m: also use layer property for plot border
John W. Eaton <jwe@octave.org>
parents:
9374
diff
changeset
|
347 fputs (plot_stream, "set border back;\n"); |
7307 | 348 endif |
7297 | 349 if (! have_grid) |
350 fputs (plot_stream, "unset grid;\n"); | |
7274 | 351 endif |
352 | |
9257
ab952265ad06
__go_draw_axes__.m: Properly render TeX symbols for x11.
Ben Abbott <bpabbott@mac.com>
parents:
9191
diff
changeset
|
353 do_tics (axis_obj, plot_stream, ymirror, mono, gnuplot_term); |
6405 | 354 |
10451
348b26872fc8
Fix bug with logscale in combination with colorbar
Petr Mikulik <mikulik@physics.muni.cz>
parents:
10238
diff
changeset
|
355 fputs (plot_stream, "unset logscale;\n"); |
6758 | 356 xlogscale = strcmpi (axis_obj.xscale, "log"); |
10451
348b26872fc8
Fix bug with logscale in combination with colorbar
Petr Mikulik <mikulik@physics.muni.cz>
parents:
10238
diff
changeset
|
357 ylogscale = strcmpi (axis_obj.yscale, "log"); |
348b26872fc8
Fix bug with logscale in combination with colorbar
Petr Mikulik <mikulik@physics.muni.cz>
parents:
10238
diff
changeset
|
358 zlogscale = strcmpi (axis_obj.zscale, "log"); |
6405 | 359 if (xlogscale) |
6809 | 360 fprintf (plot_stream, "set logscale %s;\n", xaxisloc); |
6405 | 361 endif |
362 if (ylogscale) | |
6809 | 363 fprintf (plot_stream, "set logscale %s;\n", yaxisloc); |
6405 | 364 endif |
365 if (zlogscale) | |
366 fputs (plot_stream, "set logscale z;\n"); | |
367 endif | |
368 | |
6758 | 369 xautoscale = strcmpi (axis_obj.xlimmode, "auto"); |
370 yautoscale = strcmpi (axis_obj.ylimmode, "auto"); | |
371 zautoscale = strcmpi (axis_obj.zlimmode, "auto"); | |
7109 | 372 cautoscale = strcmpi (axis_obj.climmode, "auto"); |
7471
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
373 cdatadirect = false; |
7930
1f6eb3de1c4e
__img__.m, imshow.m, __go_draw_axes__.m: improve handling of truecolor images
John W. Eaton <jwe@octave.org>
parents:
7873
diff
changeset
|
374 truecolor = false; |
6405 | 375 |
8360
32d9c0299e99
Set gnuplot two point clipping
David Bateman <dbateman@free.fr>
parents:
8354
diff
changeset
|
376 fputs (plot_stream, "set clip two;\n"); |
32d9c0299e99
Set gnuplot two point clipping
David Bateman <dbateman@free.fr>
parents:
8354
diff
changeset
|
377 |
6405 | 378 kids = axis_obj.children; |
8915
485eabc0cfec
__go_draw_axes__.m: Preserve the order of axes' children when pruning the handles for the {x,y,z}labels and title.
Ben Abbott <bpabbott@mac.com>
parents:
8909
diff
changeset
|
379 ## Remove the axis labels and title from the children, and |
485eabc0cfec
__go_draw_axes__.m: Preserve the order of axes' children when pruning the handles for the {x,y,z}labels and title.
Ben Abbott <bpabbott@mac.com>
parents:
8909
diff
changeset
|
380 ## preserved the original order. |
485eabc0cfec
__go_draw_axes__.m: Preserve the order of axes' children when pruning the handles for the {x,y,z}labels and title.
Ben Abbott <bpabbott@mac.com>
parents:
8909
diff
changeset
|
381 [jnk, k] = setdiff (kids, [axis_obj.xlabel; axis_obj.ylabel; ... |
485eabc0cfec
__go_draw_axes__.m: Preserve the order of axes' children when pruning the handles for the {x,y,z}labels and title.
Ben Abbott <bpabbott@mac.com>
parents:
8909
diff
changeset
|
382 axis_obj.zlabel; axis_obj.title]); |
485eabc0cfec
__go_draw_axes__.m: Preserve the order of axes' children when pruning the handles for the {x,y,z}labels and title.
Ben Abbott <bpabbott@mac.com>
parents:
8909
diff
changeset
|
383 kids = kids (sort (k)); |
6405 | 384 |
7316 | 385 if (nd == 3) |
386 fputs (plot_stream, "set parametric;\n"); | |
387 fputs (plot_stream, "set style data lines;\n"); | |
388 fputs (plot_stream, "set surface;\n"); | |
389 fputs (plot_stream, "unset contour;\n"); | |
390 endif | |
391 | |
6405 | 392 data_idx = 0; |
393 data = cell (); | |
6464 | 394 is_image_data = []; |
7175 | 395 hidden_removal = NaN; |
7271 | 396 view_map = false; |
6405 | 397 |
7223 | 398 xlim = axis_obj.xlim; |
399 ylim = axis_obj.ylim; | |
400 zlim = axis_obj.zlim; | |
401 clim = axis_obj.clim; | |
6405 | 402 |
7222 | 403 if (! cautoscale && clim(1) == clim(2)) |
404 clim(2)++; | |
7189 | 405 endif |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
406 addedcmap = []; |
7189 | 407 |
6405 | 408 ximg_data = {}; |
409 ximg_data_idx = 0; | |
410 | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
411 while (! isempty (kids)) |
6405 | 412 |
8344
b5f10b123440
__go_draw_axes__.m: Correct order for rendering children.
Ben Abbott <bpabbott@mac.com>
parents:
8322
diff
changeset
|
413 obj = get (kids(end)); |
10992
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
414 if (isfield (obj, "units")) |
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
415 units = obj.units; |
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
416 unwind_protect |
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
417 set (kids(end), "units", "data") |
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
418 obj = get (kids(end)); |
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
419 unwind_protect_cleanup |
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
420 set (kids(end), "units", units) |
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
421 end_unwind_protect |
88687577519f
__go_draw_axes__.m: Ensure text objects have units of "data".
Ben Abbott <bpabbott@mac.com>
parents:
10990
diff
changeset
|
422 endif |
8344
b5f10b123440
__go_draw_axes__.m: Correct order for rendering children.
Ben Abbott <bpabbott@mac.com>
parents:
8322
diff
changeset
|
423 kids = kids(1:(end-1)); |
6405 | 424 |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
425 if (strcmpi (obj.visible, "off")) |
10549 | 426 continue; |
8052
961d4c52ffae
Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents:
8048
diff
changeset
|
427 endif |
961d4c52ffae
Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents:
8048
diff
changeset
|
428 |
8171
15ffb9836c01
__go_draw_axes__.m: Remove depdenence on gnuplot version.
Ben Abbott <bpabbott@mac.com>
parents:
8166
diff
changeset
|
429 ## Check for facecolor interpolation for surfaces. |
15ffb9836c01
__go_draw_axes__.m: Remove depdenence on gnuplot version.
Ben Abbott <bpabbott@mac.com>
parents:
8166
diff
changeset
|
430 doing_interp_color = ... |
15ffb9836c01
__go_draw_axes__.m: Remove depdenence on gnuplot version.
Ben Abbott <bpabbott@mac.com>
parents:
8166
diff
changeset
|
431 isfield (obj, "facecolor") && strncmp (obj.facecolor, "interp", 6); |
8166
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
432 |
6405 | 433 switch (obj.type) |
10549 | 434 case "image" |
435 img_data = obj.cdata; | |
436 img_xdata = obj.xdata; | |
437 img_ydata = obj.ydata; | |
6405 | 438 |
11109
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
439 if (ndims (img_data) == 3) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
440 truecolor = true; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
441 elseif (strcmpi (obj.cdatamapping, "direct")) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
442 cdatadirect = true; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
443 endif |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
444 data_idx++; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
445 is_image_data(data_idx) = true; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
446 parametric(data_idx) = false; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
447 have_cdata(data_idx) = false; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
448 have_3d_patch(data_idx) = false; |
6405 | 449 |
11109
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
450 if (img_xdata(2) < img_xdata(1)) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
451 img_xdata = img_xdata(2:-1:1); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
452 img_data = img_data(:,end:-1:1,:); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
453 elseif (img_xdata(1) == img_xdata(2)) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
454 img_xdata = img_xdata(1) + [0, size(img_data,2)-1]; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
455 endif |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
456 if (img_ydata(2) < img_ydata(1)) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
457 img_ydata = img_ydata(2:-1:1); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
458 img_data = img_data(end:-1:1,:,:); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
459 elseif (img_ydata(1) == img_ydata(2)) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
460 img_ydata = img_ydata(1) + [0, size(img_data,1)-1]; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
461 endif |
11090
2adf4736dafa
Do not store flipped image property values when x/ydata descends.
Ben Abbott <bpabbott@mac.com>
parents:
11032
diff
changeset
|
462 |
11109
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
463 [y_dim, x_dim] = size (img_data(:,:,1)); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
464 if (x_dim > 1) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
465 dx = abs (img_xdata(2)-img_xdata(1))/(x_dim-1); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
466 else |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
467 x_dim = 2; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
468 img_data = [img_data, img_data]; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
469 dx = abs (img_xdata(2)-img_xdata(1)); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
470 endif |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
471 if (y_dim > 1) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
472 dy = abs (img_ydata(2)-img_ydata(1))/(y_dim-1); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
473 else |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
474 y_dim = 2; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
475 img_data = [img_data; img_data]; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
476 dy = abs (img_ydata(2)-img_ydata(1)); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
477 endif |
6405 | 478 |
11109
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
479 x_origin = min (img_xdata); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
480 y_origin = min (img_ydata); |
6405 | 481 |
11109
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
482 if (ndims (img_data) == 3) |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
483 data{data_idx} = permute (img_data, [3, 1, 2])(:); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
484 format = "1:2:3"; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
485 imagetype = "rgbimage"; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
486 else |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
487 data{data_idx} = img_data(:); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
488 format = "1"; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
489 imagetype = "image"; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
490 endif |
6405 | 491 |
11109
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
492 titlespec{data_idx} = "title \"\""; |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
493 usingclause{data_idx} = sprintf ("binary array=%dx%d scan=yx origin=(%.15g,%.15g) dx=%.15g dy=%.15g using %s", |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
494 x_dim, y_dim, x_origin, y_origin, dx, dy, format); |
41d18f6342f9
remove image_viewer function
John W. Eaton <jwe@octave.org>
parents:
11095
diff
changeset
|
495 withclause{data_idx} = sprintf ("with %s;", imagetype); |
6405 | 496 |
10549 | 497 case "line" |
498 if (strncmp (obj.linestyle, "none", 4) | |
499 && (! isfield (obj, "marker") | |
500 || (isfield (obj, "marker") | |
501 && strncmp (obj.marker, "none", 4)))) | |
502 continue; | |
503 endif | |
504 data_idx++; | |
505 is_image_data(data_idx) = false; | |
506 parametric(data_idx) = true; | |
507 have_cdata(data_idx) = false; | |
508 have_3d_patch(data_idx) = false; | |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
509 if (isempty (obj.displayname)) |
10549 | 510 titlespec{data_idx} = "title \"\""; |
511 else | |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
512 tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "displayname")); |
10549 | 513 titlespec{data_idx} = cstrcat ("title \"", tmp, "\""); |
514 endif | |
515 usingclause{data_idx} = sprintf ("record=%d", numel (obj.xdata)); | |
516 errbars = ""; | |
517 if (nd == 3) | |
518 xdat = obj.xdata(:); | |
519 ydat = obj.ydata(:); | |
520 if (! isempty (obj.zdata)) | |
521 zdat = obj.zdata(:); | |
522 else | |
523 zdat = zeros (size (xdat)); | |
524 endif | |
525 data{data_idx} = [xdat, ydat, zdat]'; | |
526 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3)", numel (xdat)); | |
527 ## fputs (plot_stream, "set parametric;\n"); | |
528 else | |
529 xdat = obj.xdata(:); | |
530 ydat = obj.ydata(:); | |
10597
ba346313bdc1
__go_draw_axes__.m: Remove gnuplot errorbar code.
Ben Abbott <bpabbott@mac.com>
parents:
10582
diff
changeset
|
531 data{data_idx} = [xdat, ydat]'; |
ba346313bdc1
__go_draw_axes__.m: Remove gnuplot errorbar code.
Ben Abbott <bpabbott@mac.com>
parents:
10582
diff
changeset
|
532 usingclause{data_idx} = sprintf ("record=%d using ($1):($2) axes %s%s", |
ba346313bdc1
__go_draw_axes__.m: Remove gnuplot errorbar code.
Ben Abbott <bpabbott@mac.com>
parents:
10582
diff
changeset
|
533 rows(xdat), xaxisloc_using, yaxisloc_using); |
10549 | 534 endif |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
535 |
10549 | 536 style = do_linestyle_command (obj, obj.color, data_idx, mono, |
537 plot_stream, errbars); | |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
538 |
10111
b52cba8be2eb
Fix for markerfacecolor and markeredgecolor properties with unfillable markers like '+'
David Bateman <dbateman@free.fr>
parents:
10089
diff
changeset
|
539 withclause{data_idx} = sprintf ("with %s linestyle %d", |
10549 | 540 style{1}, data_idx); |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
541 |
10549 | 542 if (length (style) > 1) |
543 data_idx++; | |
544 is_image_data(data_idx) = is_image_data(data_idx - 1); | |
545 parametric(data_idx) = parametric(data_idx - 1); | |
546 have_cdata(data_idx) = have_cdata(data_idx - 1); | |
547 have_3d_patch(data_idx) = have_3d_patch(data_idx - 1); | |
548 titlespec{data_idx} = "title \"\""; | |
549 usingclause{data_idx} = usingclause{data_idx - 1}; | |
550 data{data_idx} = data{data_idx - 1}; | |
551 withclause{data_idx} = sprintf ("with %s linestyle %d", | |
552 style{2}, data_idx); | |
553 endif | |
554 if (length (style) > 2) | |
555 data_idx++; | |
556 is_image_data(data_idx) = is_image_data(data_idx - 1); | |
557 parametric(data_idx) = parametric(data_idx - 1); | |
558 have_cdata(data_idx) = have_cdata(data_idx - 1); | |
559 have_3d_patch(data_idx) = have_3d_patch(data_idx - 1); | |
560 titlespec{data_idx} = "title \"\""; | |
561 usingclause{data_idx} = usingclause{data_idx - 1}; | |
562 data{data_idx} = data{data_idx - 1}; | |
563 withclause{data_idx} = sprintf ("with %s linestyle %d", | |
564 style{3}, data_idx); | |
565 endif | |
6405 | 566 |
6790 | 567 case "patch" |
6885 | 568 cmap = parent_figure_obj.colormap; |
10549 | 569 [nr, nc] = size (obj.xdata); |
7189 | 570 |
10549 | 571 if (! isempty (obj.cdata)) |
572 cdat = obj.cdata; | |
573 if (strcmpi (obj.cdatamapping, "direct")) | |
574 cdatadirect = true; | |
575 endif | |
576 else | |
577 cdat = []; | |
578 endif | |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
579 |
10549 | 580 data_3d_idx = NaN; |
581 for i = 1:nc | |
582 xcol = obj.xdata(:,i); | |
583 ycol = obj.ydata(:,i); | |
584 if (nd == 3) | |
585 if (! isempty (obj.zdata)) | |
586 zcol = obj.zdata(:,i); | |
587 else | |
588 zcol = zeros (size (xcol)); | |
589 endif | |
590 endif | |
591 | |
592 if (! isnan (xcol) && ! isnan (ycol)) | |
593 ## Is the patch closed or not | |
594 if (strncmp (obj.facecolor, "none", 4)) | |
595 hidden_removal = false; | |
596 else | |
7170 | 597 |
10549 | 598 if (isnan (hidden_removal)) |
599 hidden_removal = true; | |
600 endif | |
601 if (nd == 3) | |
602 if (numel (xcol) > 3) | |
10635
d1978e7364ad
Print name of function in error() string messages.
Rik <octave@nomad.inbox5.com>
parents:
10597
diff
changeset
|
603 error ("__go_draw_axes__: gnuplot (as of v4.2) only supports 3D filled triangular patches"); |
10549 | 604 else |
605 if (isnan (data_3d_idx)) | |
606 data_idx++; | |
607 data_3d_idx = data_idx; | |
608 is_image_data(data_idx) = false; | |
609 parametric(data_idx) = false; | |
610 have_cdata(data_idx) = true; | |
611 have_3d_patch(data_idx) = true; | |
612 withclause{data_3d_idx} = sprintf ("with pm3d"); | |
613 usingclause{data_3d_idx} = "using 1:2:3:4"; | |
614 data{data_3d_idx} = []; | |
615 endif | |
616 local_idx = data_3d_idx; | |
617 ccdat = NaN; | |
618 endif | |
7170 | 619 else |
10549 | 620 data_idx++; |
621 local_idx = data_idx; | |
622 is_image_data(data_idx) = false; | |
623 parametric(data_idx) = false; | |
624 have_cdata(data_idx) = false; | |
625 have_3d_patch(data_idx) = false; | |
7170 | 626 endif |
627 | |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
628 if (i > 1 || isempty (obj.displayname)) |
10549 | 629 titlespec{local_idx} = "title \"\""; |
630 else | |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
631 tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "displayname")); |
10549 | 632 titlespec{local_idx} = cstrcat ("title \"", tmp, "\""); |
633 endif | |
634 if (isfield (obj, "facecolor")) | |
635 if ((strncmp (obj.facecolor, "flat", 4) | |
636 || strncmp (obj.facecolor, "interp", 6)) | |
637 && isfield (obj, "cdata")) | |
638 if (ndims (obj.cdata) == 2 | |
639 && (size (obj.cdata, 2) == nc | |
640 && (size (obj.cdata, 1) == 1 | |
641 || size (obj.cdata, 1) == 3))) | |
642 ccol = cdat (:, i); | |
643 elseif (ndims (obj.cdata) == 2 | |
644 && (size (obj.cdata, 1) == nc | |
645 && (size (obj.cdata, 2) == 1 | |
646 || size (obj.cdata, 2) == 3))) | |
647 ccol = cdat (i, :); | |
648 elseif (ndims (obj.cdata) == 3) | |
649 ccol = permute (cdat (:, i, :), [1, 3, 2]); | |
650 else | |
651 ccol = cdat; | |
652 endif | |
653 if (strncmp (obj.facecolor, "flat", 4)) | |
654 if (numel(ccol) == 3) | |
655 color = ccol; | |
656 elseif (nd == 3 && numel (xcol) == 3) | |
657 ccdat = ccol * ones (3,1); | |
658 else | |
659 r = 1 + round ((size (cmap, 1) - 1) | |
660 * (ccol - clim(1))/(clim(2) - clim(1))); | |
661 r = max (1, min (r, size (cmap, 1))); | |
662 color = cmap(r, :); | |
663 endif | |
664 elseif (strncmp (obj.facecolor, "interp", 6)) | |
665 if (nd == 3 && numel (xcol) == 3) | |
666 ccdat = ccol; | |
667 if (! isvector (ccdat)) | |
668 tmp = rows(cmap) + rows(addedcmap) + ... | |
669 [1 : rows(ccdat)]; | |
670 addedcmap = [addedcmap; ccdat]; | |
671 ccdat = tmp(:); | |
672 else | |
673 ccdat = ccdat(:); | |
674 endif | |
675 else | |
676 warning ("\"interp\" not supported, using 1st entry of cdata"); | |
677 r = 1 + round ((size (cmap, 1) - 1) * ccol(1)); | |
678 r = max (1, min (r, size (cmap, 1))); | |
679 color = cmap(r,:); | |
680 endif | |
681 endif | |
682 elseif (isnumeric (obj.facecolor)) | |
683 color = obj.facecolor; | |
684 else | |
685 color = [0, 1, 0]; | |
686 endif | |
687 else | |
688 color = [0, 1, 0]; | |
689 endif | |
690 | |
691 if (nd == 3 && numel (xcol) == 3) | |
692 if (isnan (ccdat)) | |
693 ccdat = (rows (cmap) + rows(addedcmap) + 1) * ones(3, 1); | |
694 addedcmap = [addedcmap; reshape(color, 1, 3)]; | |
695 endif | |
696 data{data_3d_idx} = [data{data_3d_idx}, ... | |
697 [[xcol; xcol(end)], [ycol; ycol(end)], ... | |
698 [zcol; zcol(end)], [ccdat; ccdat(end)]]']; | |
699 else | |
700 if (mono) | |
701 colorspec = ""; | |
702 elseif (__gnuplot_has_feature__ ("transparent_patches") | |
703 && isscalar (obj.facealpha)) | |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
704 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\" fillstyle transparent solid %f", |
10549 | 705 round (255*color), obj.facealpha); |
706 else | |
707 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", | |
708 round (255*color)); | |
709 endif | |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
710 |
10549 | 711 withclause{data_idx} = sprintf ("with filledcurve %s", |
712 colorspec); | |
713 data{data_idx} = [xcol, ycol]'; | |
714 usingclause{data_idx} = sprintf ("record=%d using ($1):($2)", | |
715 numel (xcol)); | |
716 endif | |
717 endif | |
718 endif | |
7170 | 719 |
720 ## patch outline | |
10549 | 721 if (!(strncmp (obj.edgecolor, "none", 4) |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
722 && strncmp (obj.markeredgecolor, "none", 4) |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
723 && strncmp (obj.markerfacecolor, "none", 4))) |
7170 | 724 |
10549 | 725 data_idx++; |
7170 | 726 is_image_data(data_idx) = false; |
727 parametric(data_idx) = false; | |
10549 | 728 have_cdata(data_idx) = false; |
729 have_3d_patch(data_idx) = false; | |
7170 | 730 titlespec{data_idx} = "title \"\""; |
10549 | 731 usingclause{data_idx} = sprintf ("record=%d", numel (obj.xdata)); |
7189 | 732 |
10549 | 733 if (isfield (obj, "markersize")) |
734 mdat = obj.markersize / 3; | |
735 endif | |
7189 | 736 |
737 if (isfield (obj, "edgecolor")) | |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
738 ## FIXME |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
739 ## This is the wrong thing to do as edgecolor, markeredgecolor |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
740 ## and markerfacecolor can have different values and we should |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
741 ## treat them seperately. However, the below allow the scatter |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
742 ## functions to work as expected, where only one of these values |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
743 ## is set |
10549 | 744 if (strncmp (obj.edgecolor, "none", 4)) |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
745 if (strncmp (obj.markeredgecolor, "none", 4)) |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
746 ec = obj.markerfacecolor; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
747 else |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
748 ec = obj.markeredgecolor; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
749 endif |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
750 else |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
751 ec = obj.edgecolor; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
752 endif |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
753 |
10549 | 754 if ((strncmp (ec, "flat", 4) |
755 || strncmp (ec, "interp", 6)) | |
756 && isfield (obj, "cdata")) | |
757 if (ndims (obj.cdata) == 2 | |
758 && (size (obj.cdata, 2) == nc | |
759 && (size (obj.cdata, 1) == 1 | |
760 || size (obj.cdata, 1) == 3))) | |
761 ccol = cdat (:, i); | |
762 elseif (ndims (obj.cdata) == 2 | |
763 && (size (obj.cdata, 1) == nc | |
764 && (size (obj.cdata, 2) == 1 | |
765 || size (obj.cdata, 2) == 3))) | |
766 ccol = cdat (i, :); | |
767 elseif (ndims (obj.cdata) == 3) | |
768 ccol = permute (cdat (:, i, :), [1, 3, 2]); | |
769 else | |
770 ccol = cdat; | |
771 endif | |
772 if (strncmp (ec, "flat", 4)) | |
773 if (numel(ccol) == 3) | |
774 color = ccol; | |
775 else | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
776 if (isscalar (ccol)) |
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
777 ccol = repmat(ccol, numel (xcol), 1); |
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
778 endif |
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
779 color = "flat"; |
10549 | 780 have_cdata(data_idx) = true; |
781 endif | |
782 elseif (strncmp (ec, "interp", 6)) | |
783 if (numel(ccol) == 3) | |
784 warning ("\"interp\" not supported, using 1st entry of cdata"); | |
785 color = ccol(1,:); | |
786 else | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
787 if (isscalar (ccol)) |
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
788 ccol = repmat(ccol, numel (xcol), 1); |
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
789 endif |
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
790 color = "interp"; |
10549 | 791 have_cdata(data_idx) = true; |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
792 endif |
10549 | 793 endif |
794 elseif (isnumeric (ec)) | |
795 color = ec; | |
796 else | |
797 color = [0, 0, 0]; | |
798 endif | |
7020 | 799 else |
10549 | 800 color = [0, 0, 0]; |
801 endif | |
802 | |
803 if (isfield (obj, "linestyle")) | |
804 switch (obj.linestyle) | |
805 case "-" | |
806 lt = "lt 1"; | |
807 case "--" | |
808 lt = "lt 2"; | |
809 case ":" | |
810 lt = "lt 3"; | |
811 case "-." | |
812 lt = "lt 6"; | |
813 case "none" | |
814 lt = ""; | |
815 otherwise | |
816 lt = ""; | |
817 endswitch | |
818 else | |
819 lt = ""; | |
820 endif | |
821 | |
822 if (isfield (obj, "linewidth")) | |
823 lw = sprintf("linewidth %f", obj.linewidth); | |
824 else | |
825 lw = ""; | |
7020 | 826 endif |
7189 | 827 |
10933
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
828 [pt, pt2, obj] = gnuplot_pointtype (obj); |
10929
004fd6d6b7e9
__go_draw_axes__.m: Fix pointtype for patches.
Ben Abbott <bpabbott@mac.com>
parents:
10925
diff
changeset
|
829 if (! isempty (pt)) |
004fd6d6b7e9
__go_draw_axes__.m: Fix pointtype for patches.
Ben Abbott <bpabbott@mac.com>
parents:
10925
diff
changeset
|
830 pt = sprintf ("pointtype %s", pt); |
10930
b0f2b9a2b681
__go_draw_axes__.m: Additional pointtype fix.
Ben Abbott <bpabbott@mac.com>
parents:
10929
diff
changeset
|
831 endif |
b0f2b9a2b681
__go_draw_axes__.m: Additional pointtype fix.
Ben Abbott <bpabbott@mac.com>
parents:
10929
diff
changeset
|
832 if (! isempty (pt2)) |
10929
004fd6d6b7e9
__go_draw_axes__.m: Fix pointtype for patches.
Ben Abbott <bpabbott@mac.com>
parents:
10925
diff
changeset
|
833 pt2 = sprintf ("pointtype %s", pt2); |
004fd6d6b7e9
__go_draw_axes__.m: Fix pointtype for patches.
Ben Abbott <bpabbott@mac.com>
parents:
10925
diff
changeset
|
834 endif |
7189 | 835 |
10549 | 836 if (mono) |
837 colorspec = ""; | |
838 else | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
839 if (ischar (color)) |
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
840 colorspec = "palette"; |
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
841 else |
10549 | 842 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", |
843 round (255*color)); | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
844 endif |
10549 | 845 endif |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
846 |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
847 sidx = 1; |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
848 if (isempty (lt)) |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
849 style = ""; |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
850 else |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
851 style = "lines"; |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
852 endif |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
853 tmpwith = {}; |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
854 |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
855 facesame = true; |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
856 if (! isequal (pt, pt2) && isfield (obj, "markerfacecolor") |
10549 | 857 && !strncmp (obj.markerfacecolor, "none", 4)) |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
858 if (strncmp (obj.markerfacecolor, "auto", 4) |
10549 | 859 || ! isnumeric (obj.markerfacecolor) |
860 || (isnumeric (obj.markerfacecolor) | |
861 && isequal (color, obj.markerfacecolor))) | |
862 style = strcat (style, "points"); | |
863 if (isfield (obj, "markersize")) | |
864 if (length (mdat) == nc) | |
865 m = mdat(i); | |
866 else | |
867 m = mdat; | |
868 endif | |
869 ps = sprintf("pointsize %f", m / 3); | |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
870 else |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
871 ps = ""; |
10549 | 872 endif |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
873 |
10549 | 874 tmpwith{sidx} = sprintf ("with %s %s %s %s %s %s", |
875 style, lw, pt2, lt, ps, | |
876 colorspec); | |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
877 else |
10549 | 878 facesame = false; |
879 if (! isempty (style)) | |
880 tmpwith{sidx} = sprintf ("with %s %s %s %s", | |
881 style, lw, lt, | |
882 colorspec); | |
883 sidx ++; | |
884 endif | |
885 if (isnumeric (obj.markerfacecolor) && ! mono) | |
886 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", | |
887 round (255*obj.markerfacecolor)); | |
888 endif | |
889 style = "points"; | |
890 if (isfield (obj, "markersize")) | |
891 if (length (mdat) == nc) | |
892 m = mdat(i); | |
893 else | |
894 m = mdat; | |
895 endif | |
896 ps = sprintf("pointsize %f", m / 3); | |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
897 else |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
898 ps = ""; |
10549 | 899 endif |
900 tmpwith{sidx} = sprintf ("with %s %s %s %s %s %s", | |
901 style, lw, pt2, lt, ps, | |
902 colorspec); | |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
903 endif |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
904 endif |
6790 | 905 |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
906 if (isfield (obj, "markeredgecolor") |
10549 | 907 && !strncmp (obj.markeredgecolor, "none", 4)) |
10137
cf6a01e0e93f
Fix unrequested markers for patch objects
David Bateman <dbateman@free.fr>
parents:
10135
diff
changeset
|
908 if (facesame && !isempty (pt) |
cf6a01e0e93f
Fix unrequested markers for patch objects
David Bateman <dbateman@free.fr>
parents:
10135
diff
changeset
|
909 && (strncmp (obj.markeredgecolor, "auto", 4) |
10549 | 910 || ! isnumeric (obj.markeredgecolor) |
911 || (isnumeric (obj.markeredgecolor) | |
912 && isequal (color, obj.markeredgecolor)))) | |
913 if (sidx == 1 && ((length (style) == 5 | |
914 && strncmp (style, "lines", 5)) | |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
915 || isempty (style))) |
10549 | 916 style = strcat (style, "points"); |
917 if (isfield (obj, "markersize")) | |
918 if (length (mdat) == nc) | |
919 m = mdat(i); | |
920 else | |
921 m = mdat; | |
922 endif | |
923 ps = sprintf("pointsize %f", m / 3); | |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
924 else |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
925 ps = ""; |
10549 | 926 endif |
927 tmpwith{sidx} = sprintf ("with %s %s %s %s %s %s", | |
928 style, lw, pt, lt, ps, | |
929 colorspec); | |
930 endif | |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
931 else |
10549 | 932 if (!isempty (style)) |
10137
cf6a01e0e93f
Fix unrequested markers for patch objects
David Bateman <dbateman@free.fr>
parents:
10135
diff
changeset
|
933 if (length(tmpwith) < sidx || isempty (tmpwith{sidx})) |
10549 | 934 tmpwith{sidx} = sprintf ("with %s %s %s %s", |
935 style, lw, lt, | |
936 colorspec); | |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
937 endif |
10549 | 938 sidx ++; |
939 endif | |
10137
cf6a01e0e93f
Fix unrequested markers for patch objects
David Bateman <dbateman@free.fr>
parents:
10135
diff
changeset
|
940 |
cf6a01e0e93f
Fix unrequested markers for patch objects
David Bateman <dbateman@free.fr>
parents:
10135
diff
changeset
|
941 if (!isempty (pt)) |
10549 | 942 if (! mono) |
943 if (strncmp (obj.markeredgecolor, "auto", 4)) | |
944 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", | |
945 round (255*color)); | |
946 elseif (isnumeric (obj.markeredgecolor) && ! mono) | |
947 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", | |
948 round (255*obj.markeredgecolor)); | |
949 endif | |
950 endif | |
951 style = "points"; | |
952 if (isfield (obj, "markersize")) | |
953 if (length (mdat) == nc) | |
954 m = mdat(i); | |
955 else | |
956 m = mdat; | |
957 endif | |
958 ps = sprintf("pointsize %f", m / 3); | |
10137
cf6a01e0e93f
Fix unrequested markers for patch objects
David Bateman <dbateman@free.fr>
parents:
10135
diff
changeset
|
959 else |
cf6a01e0e93f
Fix unrequested markers for patch objects
David Bateman <dbateman@free.fr>
parents:
10135
diff
changeset
|
960 ps = ""; |
10549 | 961 endif |
962 tmpwith{sidx} = sprintf ("with %s %s %s %s %s %s", | |
963 style, lw, pt, lt, ps, | |
964 colorspec); | |
10137
cf6a01e0e93f
Fix unrequested markers for patch objects
David Bateman <dbateman@free.fr>
parents:
10135
diff
changeset
|
965 endif |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
966 endif |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
967 endif |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
968 |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
969 if (isempty (tmpwith)) |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
970 withclause{data_idx} = sprintf ("with %s %s %s %s %s", |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
971 style, lw, pt, lt, |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
972 colorspec); |
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
973 else |
10549 | 974 withclause{data_idx} = tmpwith{1}; |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
975 endif |
10549 | 976 if (nd == 3) |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
977 if (ischar (color)) |
10549 | 978 if (! isnan (xcol) && ! isnan (ycol) && ! isnan (zcol)) |
979 data{data_idx} = [[xcol; xcol(1)], [ycol; ycol(1)], ... | |
980 [zcol; zcol(1)], [ccol; ccol(1)]]'; | |
981 else | |
982 data{data_idx} = [xcol, ycol, zcol, ccol]'; | |
983 endif | |
984 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3):($4)", columns (data{data_idx})); | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
985 else |
10549 | 986 if (! isnan (xcol) && ! isnan (ycol) && ! isnan (zcol)) |
987 data{data_idx} = [[xcol; xcol(1)], [ycol; ycol(1)], ... | |
988 [zcol; zcol(1)]]'; | |
989 else | |
990 data{data_idx} = [xcol, ycol, zcol]'; | |
991 endif | |
992 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3)", columns (data{data_idx})); | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
993 endif |
10549 | 994 else |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
995 if (ischar (color)) |
10549 | 996 if (! isnan (xcol) && ! isnan (ycol)) |
997 data{data_idx} = [[xcol; xcol(1)], [ycol; ycol(1)], ... | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
998 [ccol; ccol(1)]]'; |
10549 | 999 else |
1000 data{data_idx} = [xcol, ycol, ccol]'; | |
1001 endif | |
1002 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3)", columns (data{data_idx})); | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
1003 else |
10549 | 1004 if (! isnan (xcol) && ! isnan (ycol)) |
1005 data{data_idx} = [[xcol; xcol(1)], [ycol; ycol(1)]]'; | |
1006 else | |
1007 data{data_idx} = [xcol, ycol]'; | |
1008 endif | |
1009 usingclause{data_idx} = sprintf ("record=%d using ($1):($2)", columns (data{data_idx})); | |
10236
8e58c402ebb2
Accelerate colormap colored scatter plots
David Bateman <dbateman@free.fr>
parents:
10226
diff
changeset
|
1010 endif |
10549 | 1011 endif |
10089
dd70982c81a3
Allow markerfacecolor and markeredgecolor to be set and used for patch objects
David Bateman <dbateman@free.fr>
parents:
9793
diff
changeset
|
1012 |
10549 | 1013 if (length (tmpwith) > 1) |
1014 data_idx++; | |
1015 is_image_data(data_idx) = is_image_data(data_idx - 1); | |
1016 parametric(data_idx) = parametric(data_idx - 1); | |
1017 have_cdata(data_idx) = have_cdata(data_idx - 1); | |
1018 have_3d_patch(data_idx) = have_3d_patch(data_idx - 1); | |
1019 titlespec{data_idx} = "title \"\""; | |
1020 usingclause{data_idx} = usingclause{data_idx - 1}; | |
1021 data{data_idx} = data{data_idx - 1}; | |
1022 withclause{data_idx} = tmpwith{2}; | |
1023 endif | |
1024 if (length (tmpwith) > 2) | |
1025 data_idx++; | |
1026 is_image_data(data_idx) = is_image_data(data_idx - 1); | |
1027 parametric(data_idx) = parametric(data_idx - 1); | |
1028 have_cdata(data_idx) = have_cdata(data_idx - 1); | |
1029 have_3d_patch(data_idx) = have_3d_patch(data_idx - 1); | |
1030 titlespec{data_idx} = "title \"\""; | |
1031 usingclause{data_idx} = usingclause{data_idx - 1}; | |
1032 data{data_idx} = data{data_idx - 1}; | |
1033 withclause{data_idx} = tmpwith{3}; | |
1034 endif | |
1035 endif | |
1036 endfor | |
6790 | 1037 |
10549 | 1038 case "surface" |
1039 view_map = true; | |
7110 | 1040 if (! (strncmp (obj.edgecolor, "none", 4) |
10549 | 1041 && strncmp (obj.facecolor, "none", 4))) |
1042 data_idx++; | |
1043 is_image_data(data_idx) = false; | |
1044 parametric(data_idx) = false; | |
1045 have_cdata(data_idx) = true; | |
1046 have_3d_patch(data_idx) = false; | |
1047 style = do_linestyle_command (obj, obj.edgecolor, | |
1048 data_idx, mono, | |
1049 plot_stream); | |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1050 |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1051 if (isempty (obj.displayname)) |
10549 | 1052 titlespec{data_idx} = "title \"\""; |
1053 else | |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1054 tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "displayname")); |
10549 | 1055 titlespec{data_idx} = cstrcat ("title \"", tmp, "\""); |
1056 endif | |
1057 withclause{data_idx} = sprintf ("with pm3d linestyle %d", | |
1058 data_idx); | |
1059 withpm3d = true; | |
1060 pm3didx = data_idx; | |
7109 | 1061 |
10549 | 1062 xdat = obj.xdata; |
1063 ydat = obj.ydata; | |
1064 zdat = obj.zdata; | |
1065 cdat = obj.cdata; | |
7110 | 1066 |
10549 | 1067 err = false; |
7109 | 1068 if (! size_equal(zdat, cdat)) |
6405 | 1069 err = true; |
7109 | 1070 endif |
10549 | 1071 if (isvector (xdat) && isvector (ydat) && ismatrix (zdat)) |
1072 if (rows (zdat) == length (ydat) | |
1073 && columns (zdat) == length (xdat)) | |
7109 | 1074 [xdat, ydat] = meshgrid (xdat, ydat); |
10549 | 1075 else |
7109 | 1076 err = true; |
10549 | 1077 endif |
1078 elseif (ismatrix (xdat) && ismatrix (ydat) && ismatrix (zdat)) | |
1079 if (! size_equal (xdat, ydat, zdat)) | |
7109 | 1080 err = true; |
10549 | 1081 endif |
1082 else | |
1083 err = true; | |
1084 endif | |
1085 if (err) | |
1086 error ("__go_draw_axes__: invalid grid data"); | |
1087 endif | |
1088 xlen = columns (zdat); | |
1089 ylen = rows (zdat); | |
1090 if (xlen == columns (xdat) && xlen == columns (ydat) | |
1091 && ylen == rows (xdat) && ylen == rows (ydat)) | |
1092 len = 4 * xlen; | |
1093 zz = zeros (ylen, len); | |
1094 k = 1; | |
1095 for kk = 1:4:len | |
1096 zz(:,kk) = xdat(:,k); | |
1097 zz(:,kk+1) = ydat(:,k); | |
1098 zz(:,kk+2) = zdat(:,k); | |
1099 zz(:,kk+3) = cdat(:,k); | |
1100 k++; | |
1101 endfor | |
1102 data{data_idx} = zz.'; | |
1103 endif | |
7109 | 1104 |
10549 | 1105 if (doing_interp_color) |
1106 interp_str = "interpolate 0, 0"; | |
1107 else | |
1108 ## No interpolation of facecolors. | |
1109 interp_str = ""; | |
1110 endif | |
1111 usingclause{data_idx} = sprintf ("record=%dx%d using ($1):($2):($3):($4)", ylen, xlen); | |
8166
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
1112 |
7119 | 1113 flat_interp_face = (strncmp (obj.facecolor, "flat", 4) |
10549 | 1114 || strncmp (obj.facecolor, "interp", 6)); |
7119 | 1115 flat_interp_edge = (strncmp (obj.edgecolor, "flat", 4) |
10549 | 1116 || strncmp (obj.edgecolor, "interp", 6)); |
7154 | 1117 |
10549 | 1118 facecolor_none_or_white = (strncmp (obj.facecolor, "none", 4) |
1119 || (isnumeric (obj.facecolor) | |
1120 && all (obj.facecolor == 1))); | |
1121 hidden_removal = false; | |
7592 | 1122 fputs (plot_stream, "set style increment default;\n"); |
7318 | 1123 if (flat_interp_edge && facecolor_none_or_white) |
10549 | 1124 withpm3d = false; |
1125 withclause{data_idx} = sprintf ("with %s palette", style {1}); | |
1126 fputs (plot_stream, "unset pm3d\n"); | |
1127 if (all (obj.facecolor == 1)) | |
7592 | 1128 hidden_removal = true; |
7582 | 1129 endif |
10549 | 1130 elseif (facecolor_none_or_white) |
1131 if (all (obj.facecolor == 1)) | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1132 hidden_removal = true; |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1133 endif |
10549 | 1134 fputs(plot_stream,"unset pm3d;\n"); |
1135 fputs(plot_stream,"set style increment user;\n"); | |
1136 withpm3d = false; | |
1137 withclause{data_idx} = sprintf("with %s linestyle %d", | |
1138 style{1}, data_idx); | |
1139 fputs (plot_stream, "unset pm3d\n"); | |
7119 | 1140 endif |
7109 | 1141 |
10549 | 1142 if (doing_interp_color) |
1143 ## "depthorder" interferes with interpolation of colors. | |
1144 dord = "scansautomatic"; | |
1145 else | |
1146 dord = "depthorder"; | |
1147 endif | |
7109 | 1148 |
10549 | 1149 if (flat_interp_face && strncmp (obj.edgecolor, "flat", 4)) |
7318 | 1150 fprintf (plot_stream, "set pm3d explicit at s %s %s corners2color c3;\n", |
10549 | 1151 interp_str, dord); |
7318 | 1152 elseif (!facecolor_none_or_white) |
7119 | 1153 if (strncmp (obj.edgecolor, "none", 4)) |
8645 | 1154 if (__gnuplot_has_feature__ ("transparent_surface") |
1155 && isscalar (obj.facealpha)) | |
1156 fprintf (plot_stream, | |
1157 "set style fill transparent solid %f;\n", | |
1158 obj.facealpha); | |
1159 endif | |
7318 | 1160 fprintf (plot_stream, "set pm3d explicit at s %s corners2color c3;\n", |
10549 | 1161 interp_str, dord); |
7109 | 1162 else |
7318 | 1163 fprintf (plot_stream, "set pm3d explicit at s hidden3d %d %s %s corners2color c3;\n", |
10549 | 1164 data_idx, interp_str, dord); |
7119 | 1165 |
8645 | 1166 if (__gnuplot_has_feature__ ("transparent_surface") |
1167 && isscalar (obj.facealpha)) | |
1168 fprintf (plot_stream, | |
1169 "set style fill transparent solid %f;\n", | |
1170 obj.facealpha); | |
1171 endif | |
7109 | 1172 endif |
7119 | 1173 endif |
10549 | 1174 |
1175 zz = []; | |
1176 if (length (style) > 1) | |
1177 len = 3 * xlen; | |
1178 zz = zeros (ylen, len); | |
1179 k = 1; | |
1180 for kk = 1:3:len | |
1181 zz(:,kk) = xdat(:,k); | |
1182 zz(:,kk+1) = ydat(:,k); | |
1183 zz(:,kk+2) = zdat(:,k); | |
1184 k++; | |
1185 endfor | |
1186 zz = zz.'; | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1187 |
10549 | 1188 data_idx++; |
1189 is_image_data(data_idx) = is_image_data(data_idx - 1); | |
1190 parametric(data_idx) = parametric(data_idx - 1); | |
1191 have_cdata(data_idx) = false; | |
1192 have_3d_patch(data_idx) = have_3d_patch(data_idx - 1); | |
1193 titlespec{data_idx} = "title \"\""; | |
1194 usingclause{data_idx} = sprintf ("record=%dx%d using ($1):($2):($3)", ylen, xlen); | |
1195 data{data_idx} = zz; | |
1196 withclause{data_idx} = sprintf ("with %s linestyle %d", | |
1197 style{2}, data_idx); | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1198 |
10549 | 1199 endif |
1200 if (length (style) > 2) | |
1201 data_idx++; | |
1202 is_image_data(data_idx) = is_image_data(data_idx - 1); | |
1203 parametric(data_idx) = parametric(data_idx - 1); | |
1204 have_cdata(data_idx) = false; | |
1205 have_3d_patch(data_idx) = have_3d_patch(data_idx - 1); | |
1206 titlespec{data_idx} = "title \"\""; | |
1207 usingclause{data_idx} = sprintf ("record=%dx%d using ($1):($2):($3)", ylen, xlen); | |
1208 data{data_idx} = zz; | |
1209 withclause{data_idx} = sprintf ("with %s linestyle %d", | |
1210 style{3}, data_idx); | |
1211 endif | |
1212 if (withpm3d && strncmp (style {1}, "linespoints", 11)) | |
1213 if (isempty(zz)) | |
1214 len = 3 * xlen; | |
1215 zz = zeros (ylen, len); | |
1216 k = 1; | |
1217 for kk = 1:3:len | |
1218 zz(:,kk) = xdat(:,k); | |
1219 zz(:,kk+1) = ydat(:,k); | |
1220 zz(:,kk+2) = zdat(:,k); | |
1221 k++; | |
1222 endfor | |
1223 zz = zz.'; | |
1224 endif | |
1225 data_idx++; | |
1226 is_image_data(data_idx) = is_image_data(data_idx - 1); | |
1227 parametric(data_idx) = parametric(data_idx - 1); | |
1228 have_cdata(data_idx) = false; | |
1229 have_3d_patch(data_idx) = have_3d_patch(data_idx - 1); | |
1230 titlespec{data_idx} = "title \"\""; | |
1231 usingclause{data_idx} = sprintf ("record=%dx%d using ($1):($2):($3)", ylen, xlen); | |
1232 data{data_idx} = zz; | |
1233 withclause{data_idx} = sprintf ("with points linestyle %d", | |
1234 pm3didx); | |
1235 endif | |
1236 endif | |
6405 | 1237 |
10549 | 1238 case "text" |
1239 [label, f, s] = __maybe_munge_text__ (enhanced, obj, "string"); | |
1240 fontspec = create_fontspec (f, s, gnuplot_term); | |
1241 lpos = obj.position; | |
1242 halign = obj.horizontalalignment; | |
1243 angle = obj.rotation; | |
6752 | 1244 units = obj.units; |
10549 | 1245 color = obj.color; |
6758 | 1246 if (strcmpi (units, "normalized")) |
6752 | 1247 units = "graph"; |
10912
9abc67b4bd4f
__go_draw_axes__.m: For yaxislocation == 'right' associate text position with 'second' coordinate system.
Ben Abbott <bpabbott@mac.com>
parents:
10911
diff
changeset
|
1248 elseif (strcmp (axis_obj.yaxislocation, "right") |
9abc67b4bd4f
__go_draw_axes__.m: For yaxislocation == 'right' associate text position with 'second' coordinate system.
Ben Abbott <bpabbott@mac.com>
parents:
10911
diff
changeset
|
1249 && strcmp (units, "data")) |
9abc67b4bd4f
__go_draw_axes__.m: For yaxislocation == 'right' associate text position with 'second' coordinate system.
Ben Abbott <bpabbott@mac.com>
parents:
10911
diff
changeset
|
1250 units = "second"; |
6752 | 1251 else |
1252 units = ""; | |
1253 endif | |
10549 | 1254 |
1255 if (isnumeric (color)) | |
1256 colorspec = get_text_colorspec (color, mono); | |
1257 endif | |
6829 | 1258 |
10549 | 1259 if (nd == 3) |
1260 fprintf (plot_stream, | |
1261 "set label \"%s\" at %s %.15g,%.15g,%.15g %s rotate by %f %s %s front %s;\n", | |
1262 undo_string_escapes (label), units, lpos(1), | |
1263 lpos(2), lpos(3), halign, angle, fontspec, | |
1264 __do_enhanced_option__ (enhanced, obj), colorspec); | |
1265 else | |
1266 fprintf (plot_stream, | |
1267 "set label \"%s\" at %s %.15g,%.15g %s rotate by %f %s %s front %s;\n", | |
1268 undo_string_escapes (label), units, | |
1269 lpos(1), lpos(2), halign, angle, fontspec, | |
1270 __do_enhanced_option__ (enhanced, obj), colorspec); | |
1271 endif | |
6405 | 1272 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1273 case "hggroup" |
10549 | 1274 ## Push group children into the kid list. |
1275 if (isempty (kids)) | |
1276 kids = obj.children; | |
1277 elseif (! isempty (obj.children)) | |
1278 kids = [kids; obj.children]; | |
1279 endif | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1280 |
10549 | 1281 otherwise |
1282 error ("__go_draw_axes__: unknown object class, %s", | |
1283 obj.type); | |
6405 | 1284 endswitch |
1285 | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1286 endwhile |
6405 | 1287 |
7692
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1288 ## This is need to prevent warnings for rotations in 3D plots, while |
8506 | 1289 ## allowing colorbars with contours. |
8042
827d4f24ec6c
Fix for meshed surfaces with more than one oobject per plot
David Bateman <dbateman@free.fr>
parents:
7930
diff
changeset
|
1290 if (nd == 2 || (data_idx > 1 && !view_map)) |
7692
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1291 fputs (plot_stream, "set pm3d implicit;\n"); |
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1292 else |
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1293 fputs (plot_stream, "set pm3d explicit;\n"); |
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1294 endif |
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1295 |
7175 | 1296 if (isnan(hidden_removal) || hidden_removal) |
7149 | 1297 fputs (plot_stream, "set hidden3d;\n"); |
1298 else | |
1299 fputs (plot_stream, "unset hidden3d;\n"); | |
1300 endif | |
1301 | |
8048
2f7ff06c0c7b
__go_draw_axes__.m (__gnuplot_write_data__): write "Inf Inf\n" if all data pairs contain NaN values
John W. Eaton <jwe@octave.org>
parents:
8042
diff
changeset
|
1302 have_data = (! (isempty (data) || all (cellfun (@isempty, data)))); |
6405 | 1303 |
8208 | 1304 ## Note we don't use the [xy]2range of gnuplot as we don't use the |
8506 | 1305 ## dual axis plotting features of gnuplot. |
7222 | 1306 if (isempty (xlim)) |
1307 return; | |
6405 | 1308 endif |
6758 | 1309 if (strcmpi (axis_obj.xdir, "reverse")) |
6405 | 1310 xdir = "reverse"; |
1311 else | |
1312 xdir = "noreverse"; | |
1313 endif | |
8208 | 1314 fprintf (plot_stream, "set xrange [%.15e:%.15e] %s;\n", xlim, xdir); |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
1315 if (strcmpi (axis_obj.xaxislocation, "top")) |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
1316 fprintf (plot_stream, "set x2range [%.15e:%.15e] %s;\n", xlim, xdir); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
1317 endif |
6405 | 1318 |
7222 | 1319 if (isempty (ylim)) |
1320 return; | |
6405 | 1321 endif |
6758 | 1322 if (strcmpi (axis_obj.ydir, "reverse")) |
6405 | 1323 ydir = "reverse"; |
1324 else | |
1325 ydir = "noreverse"; | |
1326 endif | |
8208 | 1327 fprintf (plot_stream, "set yrange [%.15e:%.15e] %s;\n", ylim, ydir); |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
1328 if (strcmpi (axis_obj.yaxislocation, "right")) |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
1329 fprintf (plot_stream, "set y2range [%.15e:%.15e] %s;\n", ylim, ydir); |
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
1330 endif |
6405 | 1331 |
7119 | 1332 if (nd == 3) |
7222 | 1333 if (isempty (zlim)) |
10549 | 1334 return; |
6405 | 1335 endif |
6758 | 1336 if (strcmpi (axis_obj.zdir, "reverse")) |
10549 | 1337 zdir = "reverse"; |
6405 | 1338 else |
10549 | 1339 zdir = "noreverse"; |
6405 | 1340 endif |
8171
15ffb9836c01
__go_draw_axes__.m: Remove depdenence on gnuplot version.
Ben Abbott <bpabbott@mac.com>
parents:
8166
diff
changeset
|
1341 fprintf (plot_stream, "set zrange [%.15e:%.15e] %s;\n", zlim, zdir); |
6405 | 1342 endif |
7110 | 1343 |
7471
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
1344 cmap = parent_figure_obj.colormap; |
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
1345 cmap_sz = rows(cmap); |
7189 | 1346 if (! any (isinf (clim))) |
7930
1f6eb3de1c4e
__img__.m, imshow.m, __go_draw_axes__.m: improve handling of truecolor images
John W. Eaton <jwe@octave.org>
parents:
7873
diff
changeset
|
1347 if (truecolor || ! cdatadirect) |
10549 | 1348 if (rows(addedcmap) > 0) |
1349 for i = 1:data_idx | |
1350 if (have_3d_patch(i)) | |
1351 data{i}(end,:) = clim(2) * (data{i}(end, :) - 0.5) / cmap_sz; | |
1352 endif | |
1353 endfor | |
1354 fprintf (plot_stream, "set cbrange [%g:%g];\n", clim(1), clim(2) * | |
1355 (cmap_sz + rows(addedcmap)) / cmap_sz); | |
1356 else | |
1357 fprintf (plot_stream, "set cbrange [%g:%g];\n", clim); | |
1358 endif | |
7930
1f6eb3de1c4e
__img__.m, imshow.m, __go_draw_axes__.m: improve handling of truecolor images
John W. Eaton <jwe@octave.org>
parents:
7873
diff
changeset
|
1359 else |
10549 | 1360 fprintf (plot_stream, "set cbrange [1:%d];\n", cmap_sz + |
1361 rows (addedcmap)); | |
7471
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
1362 endif |
7189 | 1363 endif |
1364 | |
6758 | 1365 if (strcmpi (axis_obj.box, "on")) |
7119 | 1366 if (nd == 3) |
10549 | 1367 fputs (plot_stream, "set border 4095;\n"); |
6405 | 1368 else |
10549 | 1369 fputs (plot_stream, "set border 431;\n"); |
6405 | 1370 endif |
1371 else | |
7119 | 1372 if (nd == 3) |
10549 | 1373 fputs (plot_stream, "set border 895;\n"); |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1374 elseif (! isempty (axis_obj.ytick)) |
10549 | 1375 if (strcmpi (axis_obj.yaxislocation, "right")) |
1376 fprintf (plot_stream, "unset ytics; set y2tics %s nomirror\n", | |
1377 axis_obj.tickdir); | |
1378 if (strcmpi (axis_obj.xaxislocation, "top")) | |
1379 fprintf (plot_stream, "unset xtics; set x2tics %s nomirror\n", | |
1380 axis_obj.tickdir); | |
1381 fputs (plot_stream, "set border 12;\n"); | |
1382 else | |
1383 fprintf (plot_stream, "unset x2tics; set xtics %s nomirror\n", | |
1384 axis_obj.tickdir); | |
1385 fputs (plot_stream, "set border 9;\n"); | |
1386 endif | |
1387 else | |
1388 fprintf (plot_stream, "unset y2tics; set ytics %s nomirror\n", | |
1389 axis_obj.tickdir); | |
1390 if (strcmpi (axis_obj.xaxislocation, "top")) | |
1391 fprintf (plot_stream, "unset xtics; set x2tics %s nomirror\n", | |
1392 axis_obj.tickdir); | |
1393 fputs (plot_stream, "set border 6;\n"); | |
1394 else | |
1395 fprintf (plot_stream, "unset x2tics; set xtics %s nomirror\n", | |
1396 axis_obj.tickdir); | |
1397 fputs (plot_stream, "set border 3;\n"); | |
1398 endif | |
1399 endif | |
6405 | 1400 endif |
1401 endif | |
1402 | |
7060 | 1403 if (strcmpi (axis_obj.visible, "off")) |
1404 fputs (plot_stream, "unset border; unset tics\n"); | |
7565
1e6443ff960f
handle axes linewidth property
John W. Eaton <jwe@octave.org>
parents:
7564
diff
changeset
|
1405 else |
1e6443ff960f
handle axes linewidth property
John W. Eaton <jwe@octave.org>
parents:
7564
diff
changeset
|
1406 fprintf (plot_stream, "set border lw %f;\n", axis_obj.linewidth); |
7060 | 1407 endif |
1408 | |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1409 if (! isempty (hlgnd) |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1410 && any (strcmpi (get (get (hlegend, "children"), "visible"), "on"))) |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1411 if (strcmpi (hlgnd.box, "on")) |
10549 | 1412 box = "box"; |
6405 | 1413 else |
10549 | 1414 box = "nobox"; |
6405 | 1415 endif |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1416 if (strcmpi (hlgnd.orientation, "vertical")) |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1417 horzvert = "vertical"; |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1418 else |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1419 horzvert = "horizontal"; |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1420 endif |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1421 if (strcmpi (hlgnd.textposition, "right")) |
10549 | 1422 reverse = "reverse"; |
8291
53f35799b235
Add support for left/right argument to the legend function
David Bateman <dbateman@free.fr>
parents:
8242
diff
changeset
|
1423 else |
10549 | 1424 reverse = "noreverse"; |
8291
53f35799b235
Add support for left/right argument to the legend function
David Bateman <dbateman@free.fr>
parents:
8242
diff
changeset
|
1425 endif |
6405 | 1426 inout = "inside"; |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1427 keypos = hlgnd.location; |
6977 | 1428 if (ischar (keypos)) |
10549 | 1429 keypos = lower (keypos); |
1430 keyout = findstr (keypos, "outside"); | |
1431 if (! isempty (keyout)) | |
1432 inout = "outside"; | |
1433 keypos = keypos(1:keyout-1); | |
1434 endif | |
6977 | 1435 endif |
1436 switch (keypos) | |
10549 | 1437 case "north" |
1438 pos = "center top"; | |
1439 case "south" | |
1440 pos = "center bottom"; | |
1441 case "east" | |
1442 pos = "right center"; | |
1443 case "west" | |
1444 pos = "left center"; | |
1445 case "northeast" | |
1446 pos = "right top"; | |
1447 case "northwest" | |
1448 pos = "left top"; | |
1449 case "southeast" | |
1450 pos = "right bottom"; | |
1451 case "southwest" | |
1452 pos = "left bottom"; | |
1453 case "best" | |
1454 pos = ""; | |
1455 warning ("legend: 'Best' not yet implemented for location specifier.\n"); | |
1456 ## Least conflict with data in plot. | |
1457 ## Least unused space outside plot. | |
1458 otherwise | |
1459 pos = ""; | |
6405 | 1460 endswitch |
9191
ad33527d2e51
Have 'legend' inherit font properties from the parent axis.
Ben Abbott <bpabbott@mac.com>
parents:
9110
diff
changeset
|
1461 if (__gnuplot_has_feature__ ("key_has_font_properties")) |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1462 fontspec = create_fontspec (hlgnd.fontname, hlgnd.fontsize, gnuplot_term); |
9191
ad33527d2e51
Have 'legend' inherit font properties from the parent axis.
Ben Abbott <bpabbott@mac.com>
parents:
9110
diff
changeset
|
1463 else |
10549 | 1464 fontspec = ""; |
9191
ad33527d2e51
Have 'legend' inherit font properties from the parent axis.
Ben Abbott <bpabbott@mac.com>
parents:
9110
diff
changeset
|
1465 endif |
10995
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1466 fprintf (plot_stream, "set key %s %s;\nset key %s %s %s %s;\n", |
e81914f3921f
Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents:
10992
diff
changeset
|
1467 inout, pos, box, reverse, horzvert, fontspec); |
6405 | 1468 else |
1469 fputs (plot_stream, "unset key;\n"); | |
1470 endif | |
1471 fputs (plot_stream, "set style data lines;\n"); | |
1472 | |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
1473 cmap = [cmap; addedcmap]; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
1474 cmap_sz = cmap_sz + rows(addedcmap); |
7189 | 1475 if (length(cmap) > 0) |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1476 fprintf (plot_stream, |
10549 | 1477 "set palette positive color model RGB maxcolors %i;\n", |
1478 cmap_sz); | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1479 fprintf (plot_stream, |
10549 | 1480 "set palette file \"-\" binary record=%d using 1:2:3:4;\n", |
1481 cmap_sz); | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1482 fwrite (plot_stream, [1:cmap_sz; cmap.'], "float32"); |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1483 fwrite (plot_stream, "\n"); |
7189 | 1484 endif |
8208 | 1485 |
1486 fputs (plot_stream, "unset colorbox;\n"); | |
7189 | 1487 |
6405 | 1488 if (have_data) |
1489 if (nd == 2) | |
10549 | 1490 plot_cmd = "plot"; |
6405 | 1491 else |
10549 | 1492 plot_cmd = "splot"; |
1493 rot_x = 90 - axis_obj.view(2); | |
1494 rot_z = axis_obj.view(1); | |
1495 while (rot_z < 0) | |
1496 rot_z += 360; | |
1497 endwhile | |
1498 fputs (plot_stream, "set ticslevel 0;\n"); | |
1499 if (view_map && rot_x == 0 && rot_z == 0) | |
1500 fputs (plot_stream, "set view map;\n"); | |
1501 else | |
1502 fprintf (plot_stream, "set view %.15g, %.15g;\n", rot_x, rot_z); | |
1503 endif | |
6405 | 1504 endif |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
1505 if (have_3d_patch (1)) |
10549 | 1506 fputs (plot_stream, "set pm3d depthorder\n"); |
1507 fprintf (plot_stream, "%s \"-\" %s %s %s \\\n", plot_cmd, | |
1508 usingclause{1}, titlespec{1}, withclause{1}); | |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
1509 elseif (is_image_data (1)) |
10549 | 1510 fprintf (plot_stream, "%s \"-\" %s %s %s \\\n", plot_cmd, |
1511 usingclause{1}, titlespec{1}, withclause{1}); | |
8226
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1512 else |
10549 | 1513 fprintf (plot_stream, "%s \"-\" binary format='%%float64' %s %s %s \\\n", plot_cmd, |
1514 usingclause{1}, titlespec{1}, withclause{1}); | |
8226
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1515 endif |
6405 | 1516 for i = 2:data_idx |
10549 | 1517 if (have_3d_patch (i)) |
1518 fprintf (plot_stream, ", \"-\" %s %s %s \\\n", | |
1519 usingclause{i}, titlespec{i}, withclause{i}); | |
1520 elseif (is_image_data (i)) | |
1521 if (! is_image_data (i-1)) | |
1522 fputs (plot_stream, "; "); | |
10528
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1523 if (bg_is_set) |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1524 fputs (plot_stream, "unset obj 1; \\\n"); |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1525 bg_is_set = false; |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1526 endif |
10549 | 1527 endif |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
9098
diff
changeset
|
1528 fprintf (plot_stream, "%s \"-\" %s %s %s \\\n", plot_cmd, |
10549 | 1529 usingclause{i}, titlespec{i}, withclause{i}); |
1530 elseif (is_image_data (i-1)) | |
10528
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1531 if (bg_is_set) |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1532 fputs (plot_stream, "unset obj 1; \\\n"); |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1533 bg_is_set = false; |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1534 endif |
10549 | 1535 fprintf (plot_stream, "%s \"-\" binary format='%%float64' %s %s %s \\\n", plot_cmd, |
1536 usingclause{i}, titlespec{i}, withclause{i}); | |
1537 else | |
1538 fprintf (plot_stream, ", \"-\" binary format='%%float64' %s %s %s \\\n", | |
1539 usingclause{i}, titlespec{i}, withclause{i}); | |
1540 endif | |
6405 | 1541 endfor |
1542 fputs (plot_stream, ";\n"); | |
1543 for i = 1:data_idx | |
10549 | 1544 if (have_3d_patch (i)) |
1545 ## Can't write 3d patch data as binary as can't plot more than | |
1546 ## a single patch at a time and have to plot all patches together | |
1547 ## so that the gnuplot depth ordering is done correctly | |
1548 for j = 1 : 4 : columns(data{i}) | |
1549 if (j != 1) | |
1550 fputs (plot_stream, "\n\n"); | |
1551 endif | |
1552 fprintf (plot_stream, "%.15g %.15g %.15g %.15g\n", data{i}(:,j).'); | |
1553 fprintf (plot_stream, "%.15g %.15g %.15g %.15g\n\n", data{i}(:,j+1).'); | |
1554 fprintf (plot_stream, "%.15g %.15g %.15g %.15g\n", data{i}(:,j+2).'); | |
1555 fprintf (plot_stream, "%.15g %.15g %.15g %.15g\n", data{i}(:,j+3).'); | |
1556 endfor | |
1557 fputs (plot_stream, "e\n"); | |
1558 elseif (is_image_data(i)) | |
1559 fwrite (plot_stream, data{i}, "float32"); | |
1560 else | |
1561 __gnuplot_write_data__ (plot_stream, data{i}, nd, parametric(i), | |
1562 have_cdata(i)); | |
1563 endif | |
6405 | 1564 endfor |
6431 | 1565 else |
1566 fputs (plot_stream, "plot \"-\";\nInf Inf\ne\n"); | |
6405 | 1567 endif |
1568 | |
8506 | 1569 ## Needed to allow mouse rotation with pcolor. |
7271 | 1570 if (view_map) |
1571 fputs (plot_stream, "unset view;\n"); | |
1572 endif | |
10528
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1573 |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1574 if (bg_is_set) |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1575 fputs (plot_stream, "unset obj 1;\n"); |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1576 bg_is_set = false; |
6a2e4e464d38
Unset figure color in __go_draw_axes__ (partial fix for bug #29060)
David Bateman <dbateman@free.fr>
parents:
10451
diff
changeset
|
1577 endif |
7271 | 1578 |
6405 | 1579 fflush (plot_stream); |
1580 | |
1581 else | |
1582 print_usage (); | |
7109 | 1583 endif |
6405 | 1584 |
1585 endfunction | |
1586 | |
9257
ab952265ad06
__go_draw_axes__.m: Properly render TeX symbols for x11.
Ben Abbott <bpabbott@mac.com>
parents:
9191
diff
changeset
|
1587 function fontspec = create_fontspec (f, s, gp_term) |
9468
5af462716bff
Add support for gnuplot's Lua-TikZ terminal.
Ben Abbott <bpabbott@mac.com>
parents:
9438
diff
changeset
|
1588 if (strcmp (f, "*") || strcmp (gp_term, "tikz")) |
9098
5ecdb3d3568f
Allow fontsize to be specified for all objects with fontname == "*".
Ben Abbott <bpabbott@mac.com>
parents:
9083
diff
changeset
|
1589 fontspec = sprintf ("font \",%d\"", s); |
9063
a6cf0ad87eee
__go_draw_axes__.m: New subfunction create_fontspec(). Allow fontsize to be specified when the fontname is anonymous.
Ben Abbott <bpabbott@mac.com>
parents:
9050
diff
changeset
|
1590 else |
a6cf0ad87eee
__go_draw_axes__.m: New subfunction create_fontspec(). Allow fontsize to be specified when the fontname is anonymous.
Ben Abbott <bpabbott@mac.com>
parents:
9050
diff
changeset
|
1591 fontspec = sprintf ("font \"%s,%d\"", f, s); |
a6cf0ad87eee
__go_draw_axes__.m: New subfunction create_fontspec(). Allow fontsize to be specified when the fontname is anonymous.
Ben Abbott <bpabbott@mac.com>
parents:
9050
diff
changeset
|
1592 endif |
a6cf0ad87eee
__go_draw_axes__.m: New subfunction create_fontspec(). Allow fontsize to be specified when the fontname is anonymous.
Ben Abbott <bpabbott@mac.com>
parents:
9050
diff
changeset
|
1593 endfunction |
a6cf0ad87eee
__go_draw_axes__.m: New subfunction create_fontspec(). Allow fontsize to be specified when the fontname is anonymous.
Ben Abbott <bpabbott@mac.com>
parents:
9050
diff
changeset
|
1594 |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1595 function style = do_linestyle_command (obj, linecolor, idx, mono, |
10549 | 1596 plot_stream, errbars = "") |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1597 style = {}; |
6405 | 1598 |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1599 fprintf (plot_stream, "set style line %d default;\n", idx); |
6405 | 1600 fprintf (plot_stream, "set style line %d", idx); |
1601 | |
1602 found_style = false; | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1603 if (isnumeric (linecolor)) |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1604 color = linecolor; |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1605 if (! mono) |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1606 fprintf (plot_stream, " linecolor rgb \"#%02x%02x%02x\"", |
10549 | 1607 round (255*color)); |
6405 | 1608 endif |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1609 else |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1610 color = [0, 0, 0]; |
6405 | 1611 endif |
1612 | |
1613 if (isfield (obj, "linestyle")) | |
1614 switch (obj.linestyle) | |
1615 case "-" | |
10549 | 1616 lt = "1"; |
6405 | 1617 case "--" |
10549 | 1618 lt = "2"; |
6405 | 1619 case ":" |
10549 | 1620 lt = "3"; |
6405 | 1621 case "-." |
10549 | 1622 lt = "6"; |
6405 | 1623 case "none" |
10549 | 1624 lt = ""; |
6405 | 1625 otherwise |
10549 | 1626 lt = ""; |
6405 | 1627 endswitch |
6843 | 1628 |
11095
d4619eb6ef8e
__go_draw_axes__.m: Enable linetypes for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
11090
diff
changeset
|
1629 if (! isempty (lt)) |
d4619eb6ef8e
__go_draw_axes__.m: Enable linetypes for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
11090
diff
changeset
|
1630 fprintf (plot_stream, " linetype %s", lt); |
d4619eb6ef8e
__go_draw_axes__.m: Enable linetypes for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
11090
diff
changeset
|
1631 endif |
6843 | 1632 |
6405 | 1633 else |
1634 lt = ""; | |
1635 endif | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1636 if (! isempty (errbars)) |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1637 found_style = true; |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1638 endif |
6405 | 1639 |
1640 if (isfield (obj, "linewidth")) | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1641 fprintf (plot_stream, " linewidth %f", obj.linewidth); |
6405 | 1642 found_style = true; |
1643 endif | |
1644 | |
10933
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1645 [pt, pt2, obj] = gnuplot_pointtype (obj); |
6405 | 1646 |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1647 if (! isempty (pt)) |
6465 | 1648 found_style = true; |
1649 endif | |
1650 | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1651 sidx = 1; |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1652 if (isempty (errbars)) |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1653 if (isempty (lt)) |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1654 style {sidx} = ""; |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1655 else |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1656 style {sidx} = "lines"; |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1657 endif |
11095
d4619eb6ef8e
__go_draw_axes__.m: Enable linetypes for gnuplot.
Ben Abbott <bpabbott@mac.com>
parents:
11090
diff
changeset
|
1658 |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1659 facesame = true; |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1660 if (! isequal (pt, pt2) && isfield (obj, "markerfacecolor") |
10549 | 1661 && !strncmp (obj.markerfacecolor, "none", 4)) |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1662 if (strncmp (obj.markerfacecolor, "auto", 4) |
10549 | 1663 || ! isnumeric (obj.markerfacecolor) |
1664 || (isnumeric (obj.markerfacecolor) | |
1665 && isequal (color, obj.markerfacecolor))) | |
1666 if (! isempty (pt2)) | |
1667 fprintf (plot_stream, " pointtype %s", pt2); | |
1668 style {sidx} = strcat (style{sidx}, "points"); | |
1669 endif | |
1670 if (isfield (obj, "markersize")) | |
1671 fprintf (plot_stream, " pointsize %f", obj.markersize / 3); | |
1672 endif | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1673 else |
10549 | 1674 facesame = false; |
1675 if (! found_style) | |
1676 fputs (plot_stream, " default"); | |
1677 endif | |
1678 fputs (plot_stream, ";\n"); | |
1679 if (! isempty (style {sidx})) | |
1680 sidx ++; | |
1681 idx ++; | |
1682 else | |
1683 fputs (plot_stream, ";\n"); | |
1684 endif | |
1685 fprintf (plot_stream, "set style line %d default;\n", idx); | |
1686 fprintf (plot_stream, "set style line %d", idx); | |
1687 if (isnumeric (obj.markerfacecolor) && ! mono) | |
1688 fprintf (plot_stream, " linecolor rgb \"#%02x%02x%02x\"", | |
1689 round (255*obj.markerfacecolor)); | |
1690 endif | |
1691 if (! isempty (pt2)) | |
1692 style {sidx} = "points"; | |
1693 fprintf (plot_stream, " pointtype %s", pt2); | |
1694 endif | |
1695 if (isfield (obj, "markersize")) | |
1696 fprintf (plot_stream, " pointsize %f", obj.markersize / 3); | |
1697 endif | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1698 endif |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1699 endif |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1700 if (isfield (obj, "markeredgecolor") |
10549 | 1701 && !strncmp (obj.markeredgecolor, "none", 4)) |
10157
cf17f22f1fd4
trivial fix to durface and lines for empty markers
David Bateman <dbateman@free.fr>
parents:
10137
diff
changeset
|
1702 if (facesame && !isempty (pt) |
cf17f22f1fd4
trivial fix to durface and lines for empty markers
David Bateman <dbateman@free.fr>
parents:
10137
diff
changeset
|
1703 && (strncmp (obj.markeredgecolor, "auto", 4) |
10549 | 1704 || ! isnumeric (obj.markeredgecolor) |
1705 || (isnumeric (obj.markeredgecolor) | |
1706 && isequal (color, obj.markeredgecolor)))) | |
1707 if (sidx == 1 && ((length (style {sidx}) == 5 | |
1708 && strncmp (style {sidx}, "lines", 5)) || isempty (style {sidx}))) | |
1709 if (! isempty (pt)) | |
1710 style {sidx} = strcat (style{sidx}, "points"); | |
1711 fprintf (plot_stream, " pointtype %s", pt); | |
1712 endif | |
1713 if (isfield (obj, "markersize")) | |
1714 fprintf (plot_stream, " pointsize %f", obj.markersize / 3); | |
1715 endif | |
1716 endif | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1717 else |
10549 | 1718 if (! found_style) |
1719 fputs (plot_stream, " default"); | |
1720 endif | |
1721 fputs (plot_stream, ";\n"); | |
1722 if (!isempty (style {sidx})) | |
1723 sidx ++; | |
1724 idx ++; | |
1725 else | |
1726 fputs (plot_stream, ";\n"); | |
1727 endif | |
1728 fprintf (plot_stream, "set style line %d default;\n", idx); | |
1729 fprintf (plot_stream, "set style line %d", idx); | |
1730 if (! mono) | |
1731 if (strncmp (obj.markeredgecolor, "auto", 4)) | |
1732 fprintf (plot_stream, " linecolor rgb \"#%02x%02x%02x\"", | |
1733 round (255*color)); | |
1734 elseif (isnumeric (obj.markeredgecolor) && ! mono) | |
1735 fprintf (plot_stream, " linecolor rgb \"#%02x%02x%02x\"", | |
1736 round (255*obj.markeredgecolor)); | |
1737 endif | |
1738 endif | |
1739 if (! isempty (pt)) | |
1740 style {sidx} = "points"; | |
1741 fprintf (plot_stream, " pointtype %s", pt); | |
1742 endif | |
1743 if (isfield (obj, "markersize")) | |
1744 fprintf (plot_stream, " pointsize %f", obj.markersize / 3); | |
1745 endif | |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1746 endif |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1747 endif |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1748 else |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1749 style{1} = errbars; |
10582
9676d0255440
Use "." for marker when plotting with errorbars. (bug #29057)
Rik <octave@nomad.inbox5.com>
parents:
10563
diff
changeset
|
1750 fputs (plot_stream, " pointtype 0"); |
9729
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1751 endif |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1752 |
3b7e644bb46d
Treat markerfacecolor and markeredgecolor properties for lines and surfaces
David Bateman <dbateman@free.fr>
parents:
9472
diff
changeset
|
1753 if (! found_style && isempty (style {1})) |
6405 | 1754 fputs (plot_stream, " default"); |
1755 endif | |
1756 | |
1757 fputs (plot_stream, ";\n"); | |
1758 | |
1759 endfunction | |
6510 | 1760 |
10933
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1761 function [pt, pt2, obj] = gnuplot_pointtype (obj) |
10925
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1762 if (isfield (obj, "marker")) |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1763 switch (obj.marker) |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1764 case "+" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1765 pt = pt2 = "1"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1766 case "o" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1767 pt = "6"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1768 pt2 = "7"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1769 case "*" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1770 pt = pt2 = "3"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1771 case "." |
10933
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1772 pt = "6"; |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1773 pt2 = "7"; |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1774 if (isfield (obj, "markerfacecolor") |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1775 || strncmp (obj.markerfacecolor, "none", 4)) |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1776 obj.markerfacecolor = "auto"; |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1777 endif |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1778 if (isfield (obj, "markersize")) |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1779 obj.markersize /= 3; |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1780 else |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1781 obj.markersize = 5; |
e78e531dfa2d
Improve matlab compatibility with '.' marker
David Bateman <dbateman@free.fr>
parents:
10931
diff
changeset
|
1782 endif |
10925
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1783 case "x" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1784 pt = pt2 = "2"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1785 case {"square", "s"} |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1786 pt = "4"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1787 pt2 = "5"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1788 case {"diamond", "d"} |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1789 pt = "12"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1790 pt2 = "13"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1791 case "^" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1792 pt = "8"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1793 pt2 = "9"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1794 case "v" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1795 pt = "10"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1796 pt2 = "11"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1797 case ">" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1798 ## FIXME -- should be triangle pointing right, use triangle pointing up |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1799 pt = "8"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1800 pt2 = "9"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1801 case "<" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1802 ## FIXME -- should be triangle pointing left, use triangle pointing down |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1803 pt = "10"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1804 pt2 = "11"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1805 case {"pentagram", "p"} |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1806 ## FIXME -- should be pentagram, using pentagon |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1807 pt = "14"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1808 pt2 = "15"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1809 case {"hexagram", "h"} |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1810 ## FIXME -- should be 6 pt start, using "*" instead |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1811 pt = pt2 = "3"; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1812 case "none" |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1813 pt = pt2 = ""; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1814 otherwise |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1815 pt = pt2 = ""; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1816 endswitch |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1817 else |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1818 pt = pt2 = ""; |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1819 endif |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1820 endfunction |
2f9de135e7f9
__go_draw_axes__.m: Use gnuplot's pentagon for marker == 'p'.
Ben Abbott <bpabbott@mac.com>
parents:
10920
diff
changeset
|
1821 |
7119 | 1822 function __gnuplot_write_data__ (plot_stream, data, nd, parametric, cdata) |
6510 | 1823 |
1824 ## DATA is already transposed. | |
1825 | |
1826 ## FIXME -- this may need to be converted to C++ for speed. | |
1827 | |
6605 | 1828 ## Convert NA elements to normal NaN values because fprintf writes |
1829 ## "NA" and that confuses gnuplot. | |
1830 idx = find (isna (data)); | |
1831 if (any (idx)) | |
1832 data(idx) = NaN; | |
1833 endif | |
1834 | |
6510 | 1835 if (nd == 2) |
8217
f74cb5e3a6c1
send binary data to gnuplot
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8216
diff
changeset
|
1836 fwrite (plot_stream, data, "float64"); |
7109 | 1837 elseif (nd == 3) |
6510 | 1838 if (parametric) |
8217
f74cb5e3a6c1
send binary data to gnuplot
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8216
diff
changeset
|
1839 fwrite (plot_stream, data, "float64"); |
6510 | 1840 else |
7170 | 1841 nr = rows (data); |
7119 | 1842 if (cdata) |
10549 | 1843 for j = 1:4:nr |
1844 fwrite (plot_stream, data(j:j+3,:), "float64"); | |
1845 endfor | |
7119 | 1846 else |
10549 | 1847 for j = 1:3:nr |
1848 fwrite (plot_stream, data(j:j+2,:), "float64"); | |
1849 endfor | |
7119 | 1850 endif |
7109 | 1851 endif |
6510 | 1852 endif |
1853 | |
1854 endfunction | |
6745 | 1855 |
9257
ab952265ad06
__go_draw_axes__.m: Properly render TeX symbols for x11.
Ben Abbott <bpabbott@mac.com>
parents:
9191
diff
changeset
|
1856 function do_tics (obj, plot_stream, ymirror, mono, gnuplot_term) |
8222
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1857 |
8518
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1858 obj.xticklabel = ticklabel_to_cell (obj.xticklabel); |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1859 obj.yticklabel = ticklabel_to_cell (obj.yticklabel); |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1860 obj.zticklabel = ticklabel_to_cell (obj.zticklabel); |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1861 |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1862 if (strcmp (obj.xminorgrid, "on")) |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1863 obj.xminortick = "on"; |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1864 endif |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1865 if (strcmp (obj.yminorgrid, "on")) |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1866 obj.yminortick = "on"; |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1867 endif |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1868 if (strcmp (obj.zminorgrid, "on")) |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1869 obj.zminortick = "on"; |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1870 endif |
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1871 |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1872 [fontname, fontsize] = get_fontname_and_size (obj); |
9257
ab952265ad06
__go_draw_axes__.m: Properly render TeX symbols for x11.
Ben Abbott <bpabbott@mac.com>
parents:
9191
diff
changeset
|
1873 fontspec = create_fontspec (fontname, fontsize, gnuplot_term); |
8222
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1874 |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1875 ## A Gnuplot tic scale of 69 is equivalent to Octave's 0.5. |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1876 ticklength = sprintf ("scale %4.1f", (69/0.5)*obj.ticklength(1)); |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1877 |
6809 | 1878 if (strcmpi (obj.xaxislocation, "top")) |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1879 do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, |
10549 | 1880 obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, |
1881 "border", obj.tickdir, ticklength, fontname, fontspec, | |
1882 obj.interpreter, obj.xscale); | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1883 do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, |
10549 | 1884 obj.xcolor, "x", plot_stream, true, mono, "border", |
1885 "", "", fontname, fontspec, obj.interpreter, obj.xscale); | |
7321 | 1886 elseif (strcmpi (obj.xaxislocation, "zero")) |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1887 do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, |
10549 | 1888 obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, |
1889 "axis", obj.tickdir, ticklength, fontname, fontspec, | |
1890 obj.interpreter, obj.xscale); | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1891 do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, |
10549 | 1892 obj.xcolor, "x2", plot_stream, true, mono, "axis", |
1893 "", "", fontname, fontspec, obj.interpreter, obj.xscale); | |
6809 | 1894 else |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1895 do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, |
10549 | 1896 obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, |
1897 "border", obj.tickdir, ticklength, fontname, fontspec, | |
1898 obj.interpreter, obj.xscale); | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1899 do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, |
10549 | 1900 obj.xcolor, "x2", plot_stream, true, mono, "border", |
1901 "", "", fontname, fontspec, obj.interpreter, obj.xscale); | |
6809 | 1902 endif |
1903 if (strcmpi (obj.yaxislocation, "right")) | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1904 do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, |
10549 | 1905 obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, |
1906 "border", obj.tickdir, ticklength, fontname, fontspec, | |
1907 obj.interpreter, obj.yscale); | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1908 do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, |
10549 | 1909 obj.ycolor, "y", plot_stream, ymirror, mono, "border", |
1910 "", "", fontname, fontspec, obj.interpreter, obj.yscale); | |
8943
4a312440b262
__go_draw_axes__.m (do_tics): fix typo
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
1911 elseif (strcmpi (obj.yaxislocation, "zero")) |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1912 do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, |
10549 | 1913 obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, |
1914 "axis", obj.tickdir, ticklength, fontname, fontspec, | |
1915 obj.interpreter, obj.yscale); | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1916 do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, |
10549 | 1917 obj.ycolor, "y2", plot_stream, ymirror, mono, "axis", |
1918 "", "", fontname, fontspec, obj.interpreter, obj.yscale); | |
6809 | 1919 else |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1920 do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, |
10549 | 1921 obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, |
1922 "border", obj.tickdir, ticklength, fontname, fontspec, | |
1923 obj.interpreter, obj.yscale); | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1924 do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, |
10549 | 1925 obj.ycolor, "y2", plot_stream, ymirror, mono, "border", |
1926 "", "", fontname, fontspec, obj.interpreter, obj.yscale); | |
6809 | 1927 endif |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1928 do_tics_1 (obj.ztickmode, obj.ztick, obj.zminortick, obj.zticklabelmode, |
10549 | 1929 obj.zticklabel, obj.zcolor, "z", plot_stream, true, mono, |
1930 "border", obj.tickdir, ticklength, fontname, fontspec, | |
1931 obj.interpreter, obj.yscale); | |
6745 | 1932 endfunction |
1933 | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1934 function do_tics_1 (ticmode, tics, mtics, labelmode, labels, color, ax, |
10549 | 1935 plot_stream, mirror, mono, axispos, tickdir, ticklength, |
1936 fontname, fontspec, interpreter, scale) | |
8222
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1937 persistent warned_latex = false; |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1938 if (strcmpi (interpreter, "tex")) |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1939 for n = 1 : numel(labels) |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1940 labels{n} = __tex2enhanced__ (labels{n}, fontname, false, false); |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1941 endfor |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1942 elseif (strcmpi (interpreter, "latex")) |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1943 if (! warned_latex) |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1944 warning ("latex markup not supported for tick marks"); |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1945 warned_latex = true; |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1946 endif |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1947 endif |
9302
5542c40e40ac
__go_draw_axes__.m: Change strncmpi(scale,'lo') -> strcmp(scale,'log').
Ben Abbott <bpabbott@mac.com>
parents:
9301
diff
changeset
|
1948 if (strcmp (scale, "log")) |
9301
f2152fad3563
__go_draw_axes__.m: For log-scale axes use format '10^{%T}'.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
1949 fmt = "10^{%T}"; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1950 num_mtics = 10; |
9301
f2152fad3563
__go_draw_axes__.m: For log-scale axes use format '10^{%T}'.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
1951 else |
f2152fad3563
__go_draw_axes__.m: For log-scale axes use format '10^{%T}'.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
1952 fmt = "%g"; |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
1953 num_mtics = 5; |
9301
f2152fad3563
__go_draw_axes__.m: For log-scale axes use format '10^{%T}'.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
1954 endif |
7269 | 1955 colorspec = get_text_colorspec (color, mono); |
8112
31e86163b752
Add the datetick function
David Bateman <dbateman@free.fr>
parents:
8102
diff
changeset
|
1956 if (strcmpi (ticmode, "manual") || strcmpi (labelmode, "manual")) |
6745 | 1957 if (isempty (tics)) |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1958 fprintf (plot_stream, "unset %stics;\nunset m%stics;\n", ax, ax); |
8953
a6945f92b868
__go_draw_axes__.m: Unset the {x,y,z}ticks when initializing\n\teach axis. Set ticklabels when the ticklabels are empty and when\n\tticklabelmode=="manual".
Ben Abbott <bpabbott@mac.com>
parents:
8943
diff
changeset
|
1959 elseif (strcmpi (labelmode, "manual")) |
6751 | 1960 if (ischar (labels)) |
10549 | 1961 labels = cellstr (labels); |
6751 | 1962 endif |
8354
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1963 if (isnumeric (labels)) |
10549 | 1964 labels = num2str (real (labels(:))); |
8354
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1965 endif |
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1966 if (ischar (labels)) |
10549 | 1967 labels = permute (cellstr (labels), [2, 1]); |
8354
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1968 endif |
6745 | 1969 if (iscellstr (labels)) |
10549 | 1970 k = 1; |
1971 ntics = numel (tics); | |
1972 nlabels = numel (labels); | |
1973 fprintf (plot_stream, "set format %s \"%%s\";\n", ax); | |
1974 if (mirror) | |
1975 fprintf (plot_stream, "set %stics %s %s %s mirror (", ax, | |
1976 tickdir, ticklength, axispos); | |
1977 else | |
1978 fprintf (plot_stream, "set %stics %s %s %s nomirror (", ax, | |
1979 tickdir, ticklength, axispos); | |
1980 endif | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1981 |
11032
c9b0a75b02e8
Make all regexp in Octave compatible with both POSIX and PCRE.
Rik <octave@nomad.inbox5.com>
parents:
11001
diff
changeset
|
1982 labels = regexprep(labels, '%', "%%"); |
10549 | 1983 for i = 1:ntics |
1984 fprintf (plot_stream, " \"%s\" %.15g", labels{k++}, tics(i)); | |
1985 if (i < ntics) | |
1986 fputs (plot_stream, ", "); | |
1987 endif | |
1988 if (k > nlabels) | |
1989 k = 1; | |
1990 endif | |
1991 endfor | |
1992 fprintf (plot_stream, ") %s %s;\n", colorspec, fontspec); | |
1993 if (strcmp (mtics, "on")) | |
1994 fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics); | |
1995 else | |
1996 fprintf (plot_stream, "unset m%stics;\n", ax); | |
1997 endif | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1998 else |
10635
d1978e7364ad
Print name of function in error() string messages.
Rik <octave@nomad.inbox5.com>
parents:
10597
diff
changeset
|
1999 error ("__go_draw_axes__: unsupported type of ticklabel"); |
6745 | 2000 endif |
2001 else | |
9301
f2152fad3563
__go_draw_axes__.m: For log-scale axes use format '10^{%T}'.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
2002 fprintf (plot_stream, "set format %s \"%s\";\n", ax, fmt); |
7206 | 2003 if (mirror) |
10549 | 2004 fprintf (plot_stream, "set %stics %s %s %s mirror (", ax, tickdir, |
2005 ticklength, axispos); | |
7206 | 2006 else |
10549 | 2007 fprintf (plot_stream, "set %stics %s %s %s nomirror (", ax, tickdir, |
2008 ticklength, axispos); | |
7206 | 2009 endif |
8112
31e86163b752
Add the datetick function
David Bateman <dbateman@free.fr>
parents:
8102
diff
changeset
|
2010 fprintf (plot_stream, " %.15g,", tics(1:end-1)); |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
2011 fprintf (plot_stream, " %.15g) %s;\n", tics(end), fontspec); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2012 if (strcmp (mtics, "on")) |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
2013 fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2014 else |
10549 | 2015 fprintf (plot_stream, "unset m%stics;\n", ax); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2016 endif |
6745 | 2017 endif |
2018 else | |
9301
f2152fad3563
__go_draw_axes__.m: For log-scale axes use format '10^{%T}'.
Ben Abbott <bpabbott@mac.com>
parents:
9281
diff
changeset
|
2019 fprintf (plot_stream, "set format %s \"%s\";\n", ax, fmt); |
7206 | 2020 if (mirror) |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
2021 fprintf (plot_stream, "set %stics %s %s %s mirror %s %s;\n", ax, |
10549 | 2022 axispos, tickdir, ticklength, colorspec, fontspec); |
7206 | 2023 else |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
2024 fprintf (plot_stream, "set %stics %s %s %s nomirror %s %s;\n", ax, |
10549 | 2025 tickdir, ticklength, axispos, colorspec, fontspec); |
7206 | 2026 endif |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2027 if (strcmp (mtics, "on")) |
9374
6a035159ba0e
grid.m: Add missing semi-colon. Fix grid toggle. Allow minor grid when no minor tick.
Ben Abbott <bpabbott@mac.com>
parents:
9361
diff
changeset
|
2028 fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2029 else |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2030 fprintf (plot_stream, "unset m%stics;\n", ax); |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2031 endif |
7194 | 2032 endif |
2033 endfunction | |
2034 | |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
2035 function ticklabel = ticklabel_to_cell (ticklabel) |
9472
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2036 if (isnumeric (ticklabel)) |
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2037 ## Use upto 5 significant digits |
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2038 ticklabel = num2str (ticklabel(:), 5); |
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2039 endif |
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2040 if (ischar (ticklabel)) |
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2041 if (size (ticklabel, 1) == 1 && any (ticklabel == "|")) |
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2042 n = setdiff (findstr (ticklabel, "|"), findstr (ticklabel, '\|')); |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
2043 ticklabel = strsplit (ticklabel, "|"); |
9280
40fb718a2e67
__go_draw_axes__.m: Add support for ticklabel separator '|'.
Ben Abbott <bpabbott@mac.com>
parents:
9272
diff
changeset
|
2044 else |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
2045 ticklabel = cellstr (ticklabel); |
9280
40fb718a2e67
__go_draw_axes__.m: Add support for ticklabel separator '|'.
Ben Abbott <bpabbott@mac.com>
parents:
9272
diff
changeset
|
2046 endif |
9472
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2047 elseif (isempty (ticklabel)) |
303f862a896d
__go_draw_axes__.m: Fix ticklabels specified as 2D character array.
Ben Abbott <bpabbott@mac.com>
parents:
9468
diff
changeset
|
2048 ticklabel = {""}; |
9280
40fb718a2e67
__go_draw_axes__.m: Add support for ticklabel separator '|'.
Ben Abbott <bpabbott@mac.com>
parents:
9272
diff
changeset
|
2049 else |
9281
02b16eeb3167
Fix yticklabels for log scale colorbar.
Ben Abbott <bpabbott@mac.com>
parents:
9280
diff
changeset
|
2050 ticklabel = ticklabel; |
8518
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
2051 endif |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
2052 endfunction |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
2053 |
7269 | 2054 function colorspec = get_text_colorspec (color, mono) |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
2055 if (mono) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
2056 colorspec = ""; |
7194 | 2057 else |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
2058 colorspec = sprintf ("textcolor rgb \"#%02x%02x%02x\"", |
10549 | 2059 round (255*color)); |
6745 | 2060 endif |
2061 endfunction | |
7163 | 2062 |
7189 | 2063 function [f, s, fnt, it, bld] = get_fontname_and_size (t) |
7163 | 2064 if (isempty (t.fontname)) |
7372 | 2065 fnt = "Helvetica"; |
7163 | 2066 else |
7372 | 2067 fnt = t.fontname; |
7168 | 2068 endif |
7189 | 2069 f = fnt; |
2070 it = false; | |
2071 bld = false; | |
7372 | 2072 if (! isempty (t.fontweight) && strcmpi (t.fontweight, "bold")) |
7168 | 2073 if (! isempty(t.fontangle) |
10549 | 2074 && (strcmpi (t.fontangle, "italic") |
2075 || strcmpi (t.fontangle, "oblique"))) | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2076 f = cstrcat (f, "-bolditalic"); |
7189 | 2077 it = true; |
2078 bld = true; | |
7168 | 2079 else |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2080 f = cstrcat (f, "-bold"); |
7189 | 2081 bld = true; |
7168 | 2082 endif |
2083 elseif (! isempty(t.fontangle) | |
10549 | 2084 && (strcmpi (t.fontangle, "italic") |
2085 || strcmpi (t.fontangle, "oblique"))) | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2086 f = cstrcat (f, "-italic"); |
7189 | 2087 it = true; |
7163 | 2088 endif |
2089 if (isempty (t.fontsize)) | |
2090 s = 10; | |
2091 else | |
2092 s = t.fontsize; | |
2093 endif | |
2094 endfunction | |
7189 | 2095 |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
2096 function [str, f, s] = __maybe_munge_text__ (enhanced, obj, fld) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
2097 |
7189 | 2098 persistent warned_latex = false; |
2099 | |
2100 if (strcmp (fld, "string")) | |
2101 [f, s, fnt, it, bld] = get_fontname_and_size (obj); | |
2102 else | |
7372 | 2103 f = "Helvetica"; |
7189 | 2104 s = 10; |
2105 fnt = f; | |
2106 it = false; | |
2107 bld = false; | |
2108 endif | |
2109 | |
2110 str = getfield (obj, fld); | |
2111 if (enhanced) | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
2112 if (strcmpi (obj.interpreter, "tex")) |
7189 | 2113 str = __tex2enhanced__ (str, fnt, it, bld); |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
2114 elseif (strcmpi (obj.interpreter, "latex")) |
7189 | 2115 if (! warned_latex) |
10549 | 2116 warning ("latex markup not supported for text objects"); |
2117 warned_latex = true; | |
7189 | 2118 endif |
2119 endif | |
2120 endif | |
2121 endfunction | |
2122 | |
2123 function str = __tex2enhanced__ (str, fnt, it, bld) | |
2124 persistent sym = __setup_sym_table__ (); | |
2125 persistent flds = fieldnames (sym); | |
2126 | |
2127 [s, e, m] = regexp(str,'\\([a-zA-Z]+|0)','start','end','matches'); | |
2128 | |
2129 for i = length (s) : -1 : 1 | |
2130 ## special case for "\0" and replace with "{/Symbol \306}' | |
2131 if (strncmp (m{i}, '\0', 2)) | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2132 str = cstrcat (str(1:s(i) - 1), '{/Symbol \306}', str(s(i) + 2:end)); |
7189 | 2133 else |
2134 f = m{i}(2:end); | |
2135 if (isfield (sym, f)) | |
10549 | 2136 g = getfield(sym, f); |
2137 ## FIXME The symbol font doesn't seem to support bold or italic | |
2138 ##if (bld) | |
2139 ## if (it) | |
2140 ## g = regexprep (g, '/Symbol', '/Symbol-bolditalic'); | |
2141 ## else | |
2142 ## g = regexprep (g, '/Symbol', '/Symbol-bold'); | |
2143 ## endif | |
2144 ##elseif (it) | |
2145 ## g = regexprep (g, '/Symbol', '/Symbol-italic'); | |
2146 ##endif | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2147 str = cstrcat (str(1:s(i) - 1), g, str(e(i) + 1:end)); |
7189 | 2148 elseif (strncmp (f, "rm", 2)) |
10549 | 2149 bld = false; |
2150 it = false; | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2151 str = cstrcat (str(1:s(i) - 1), '/', fnt, ' ', str(s(i) + 3:end)); |
7189 | 2152 elseif (strncmp (f, "it", 2) || strncmp (f, "sl", 2)) |
10549 | 2153 it = true; |
2154 if (bld) | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2155 str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bolditalic ', |
10549 | 2156 str(s(i) + 3:end)); |
7189 | 2157 else |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2158 str = cstrcat (str(1:s(i) - 1), '/', fnt, '-italic ', |
10549 | 2159 str(s(i) + 3:end)); |
7189 | 2160 endif |
2161 elseif (strncmp (f, "bf", 2)) | |
10549 | 2162 bld = true; |
2163 if (it) | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2164 str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bolditalic ', |
10549 | 2165 str(2(i) + 3:end)); |
7189 | 2166 else |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2167 str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bold ', |
10549 | 2168 str(s(i) + 3:end)); |
7189 | 2169 endif |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
2170 elseif (strcmpi (f, "color")) |
10549 | 2171 ## FIXME Ignore \color but remove trailing {} block as well |
2172 d = strfind(str(e(i) + 1:end),'}'); | |
7189 | 2173 if (isempty (d)) |
10549 | 2174 warning ('syntax error in \color argument'); |
2175 else | |
2176 str = cstrcat (str(1:s(i) - 1), str(e(i) + d + 1:end)); | |
7189 | 2177 endif |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
2178 elseif(strcmpi (f, "fontname")) |
10549 | 2179 b1 = strfind(str(e(i) + 1:end),'{'); |
2180 b2 = strfind(str(e(i) + 1:end),'}'); | |
7189 | 2181 if (isempty(b1) || isempty(b2)) |
10549 | 2182 warning ('syntax error in \fontname argument'); |
2183 else | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2184 str = cstrcat (str(1:s(i) - 1), '/', |
10549 | 2185 str(e(i)+b1(1) + 1:e(i)+b2(1)-1), '{}', |
2186 str(e(i) + b2(1) + 1:end)); | |
7189 | 2187 endif |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
2188 elseif(strcmpi (f, "fontsize")) |
10549 | 2189 b1 = strfind(str(e(i) + 1:end),'{'); |
2190 b2 = strfind(str(e(i) + 1:end),'}'); | |
7189 | 2191 if (isempty(b1) || isempty(b2)) |
10549 | 2192 warning ('syntax error in \fontname argument'); |
2193 else | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2194 str = cstrcat (str(1:s(i) - 1), '/=', |
10549 | 2195 str(e(i)+b1(1) + 1:e(i)+b2(1)-1), '{}', |
2196 str(e(i) + b2(1) + 1:end)); | |
7189 | 2197 endif |
2198 else | |
10549 | 2199 ## Last desperate attempt to treat the symbol. Look for things |
2200 ## like \pix, that should be translated to the symbol Pi and x | |
2201 for j = 1 : length (flds) | |
2202 if (strncmp (flds{j}, f, length (flds{j}))) | |
2203 g = getfield(sym, flds{j}); | |
2204 ## FIXME The symbol font doesn't seem to support bold or italic | |
2205 ##if (bld) | |
2206 ## if (it) | |
2207 ## g = regexprep (g, '/Symbol', '/Symbol-bolditalic'); | |
2208 ## else | |
2209 ## g = regexprep (g, '/Symbol', '/Symbol-bold'); | |
2210 ## endif | |
2211 ##elseif (it) | |
2212 ## g = regexprep (g, '/Symbol', '/Symbol-italic'); | |
2213 ##endif | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
2214 str = cstrcat (str(1:s(i) - 1), g, |
10549 | 2215 str(s(i) + length (flds{j}) + 1:end)); |
2216 break; | |
2217 endif | |
2218 endfor | |
7189 | 2219 endif |
2220 endif | |
2221 endfor | |
2222 | |
8506 | 2223 ## Prepend @ to things things like _0^x or _{-100}^{100} for |
2224 ## alignment But need to put the shorter of the two arguments first. | |
2225 ## Carful of nested {} and unprinted characters when defining | |
2226 ## shortest.. Don't have to worry about things like ^\theta as they | |
2227 ## are already converted to ^{/Symbol q}. | |
7189 | 2228 |
8506 | 2229 ## FIXME -- This is a mess... Is it worth it just for a "@" character? |
7189 | 2230 |
2231 [s, m] = regexp(str,'[_\^]','start','matches'); | |
2232 i = 1; | |
2233 p = 0; | |
2234 while (i < length (s)) | |
2235 if (i < length(s)) | |
2236 if (str(s(i) + p + 1) == "{") | |
10549 | 2237 s1 = strfind(str(s(i) + p + 2:end),'{'); |
2238 si = 1; | |
2239 l1 = strfind(str(s(i) + p + 1:end),'}'); | |
7189 | 2240 li = 1; |
10549 | 2241 while (li <= length (l1) && si <= length (s1)) |
7189 | 2242 if (l1(li) < s1(si)) |
10549 | 2243 if (li == si) |
2244 break; | |
2245 endif | |
2246 li++; | |
2247 else | |
2248 si++; | |
2249 endif | |
2250 endwhile | |
2251 l1 = l1 (min (length(l1), si)); | |
7189 | 2252 if (s(i) + l1 + 1 == s(i+1)) |
10549 | 2253 if (str(s(i + 1) + p + 1) == "{") |
2254 s2 = strfind(str(s(i + 1) + p + 2:end),'{'); | |
2255 si = 1; | |
2256 l2 = strfind(str(s(i + 1) + p + 1:end),'}'); | |
7189 | 2257 li = 1; |
10549 | 2258 while (li <= length (l2) && si <= length (s2)) |
7189 | 2259 if (l2(li) < s2(si)) |
10549 | 2260 if (li == si) |
2261 break; | |
2262 endif | |
2263 li++; | |
2264 else | |
2265 si++; | |
2266 endif | |
2267 endwhile | |
2268 l2 = l2 (min (length(l2), si)); | |
2269 if (length_string (str(s(i)+p+2:s(i)+p+l1-1)) <= | |
2270 length_string(str(s(i+1)+p+2:s(i+1)+p+l2-1))) | |
2271 ## Shortest already first! | |
2272 str = cstrcat (str(1:s(i)+p-1), "@", str(s(i)+p:end)); | |
2273 else | |
2274 ## Have to swap sub/super-script to get shortest first. | |
2275 str = cstrcat (str(1:s(i)+p-1), "@", str(s(i+1)+p:s(i+1)+p+l2), | |
2276 str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+l2+1:end)); | |
2277 endif | |
2278 else | |
2279 ## Have to swap sub/super-script to get shortest first. | |
2280 str = cstrcat (str(1:s(i)+p-1), "@", str(s(i+1)+p:s(i+1)+p+1), | |
2281 str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+2:end)); | |
2282 endif | |
7189 | 2283 i += 2; |
10549 | 2284 p ++; |
2285 else | |
2286 i++; | |
2287 endif | |
7189 | 2288 else |
10549 | 2289 if (s(i+1) == s(i) + 2) |
2290 ## Shortest already first! | |
2291 str = cstrcat (str(1:s(i)+p-1), "@", str(s(i)+p:end)); | |
2292 p ++; | |
7189 | 2293 i += 2; |
10549 | 2294 else |
2295 i ++; | |
2296 endif | |
7189 | 2297 endif |
2298 else | |
2299 i ++; | |
2300 endif | |
2301 endwhile | |
2302 | |
2303 endfunction | |
2304 | |
2305 function l = length_string (s) | |
2306 l = length (s) - length (strfind(s,'{')) - length (strfind(s,'}')); | |
11032
c9b0a75b02e8
Make all regexp in Octave compatible with both POSIX and PCRE.
Rik <octave@nomad.inbox5.com>
parents:
11001
diff
changeset
|
2307 m = regexp (s, '/([a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+=[0-9]+)', 'matches'); |
7189 | 2308 if (!isempty (m)) |
2309 l = l - sum (cellfun (@length, m)); | |
2310 endif | |
2311 endfunction | |
2312 | |
2313 function sym = __setup_sym_table__ () | |
2314 ## Setup the translation table for TeX to gnuplot enhanced mode. | |
2315 sym.forall = '{/Symbol \042}'; | |
2316 sym.exists = '{/Symbol \044}'; | |
2317 sym.ni = '{/Symbol \047}'; | |
2318 sym.cong = '{/Symbol \100}'; | |
2319 sym.Delta = '{/Symbol D}'; | |
2320 sym.Phi = '{/Symbol F}'; | |
7608
49810341db91
Correct typos in __go_draw_axes__.m and update Manual
godfrey@qss.Stanford.EDU
parents:
7603
diff
changeset
|
2321 sym.Gamma = '{/Symbol G}'; |
7190 | 2322 sym.vartheta = '{/Symbol J}'; |
7189 | 2323 sym.Lambda = '{/Symbol L}'; |
2324 sym.Pi = '{/Symbol P}'; | |
2325 sym.Theta = '{/Symbol Q}'; | |
2326 sym.Sigma = '{/Symbol S}'; | |
2327 sym.varsigma = '{/Symbol V}'; | |
7420 | 2328 sym.Omega = '{/Symbol W}'; |
7189 | 2329 sym.Xi = '{/Symbol X}'; |
2330 sym.Psi = '{/Symbol Y}'; | |
2331 sym.perp = '{/Symbol \136}'; | |
2332 sym.alpha = '{/Symbol a}'; | |
2333 sym.beta = '{/Symbol b}'; | |
2334 sym.chi = '{/Symbol c}'; | |
2335 sym.delta = '{/Symbol d}'; | |
2336 sym.epsilon = '{/Symbol e}'; | |
2337 sym.phi = '{/Symbol f}'; | |
7608
49810341db91
Correct typos in __go_draw_axes__.m and update Manual
godfrey@qss.Stanford.EDU
parents:
7603
diff
changeset
|
2338 sym.gamma = '{/Symbol g}'; |
7189 | 2339 sym.eta = '{/Symbol h}'; |
2340 sym.iota = '{/Symbol i}'; | |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2341 sym.varphi = '{/Symbol j}'; |
7189 | 2342 sym.kappa = '{/Symbol k}'; |
2343 sym.lambda = '{/Symbol l}'; | |
2344 sym.mu = '{/Symbol m}'; | |
2345 sym.nu = '{/Symbol n}'; | |
2346 sym.o = '{/Symbol o}'; | |
2347 sym.pi = '{/Symbol p}'; | |
2348 sym.theta = '{/Symbol q}'; | |
2349 sym.rho = '{/Symbol r}'; | |
2350 sym.sigma = '{/Symbol s}'; | |
2351 sym.tau = '{/Symbol t}'; | |
2352 sym.upsilon = '{/Symbol u}'; | |
2353 sym.varpi = '{/Symbol v}'; | |
2354 sym.omega = '{/Symbol w}'; | |
2355 sym.xi = '{/Symbol x}'; | |
2356 sym.psi = '{/Symbol y}'; | |
2357 sym.zeta = '{/Symbol z}'; | |
2358 sym.sim = '{/Symbol \176}'; | |
2359 sym.Upsilon = '{/Symbol \241}'; | |
2360 sym.prime = '{/Symbol \242}'; | |
2361 sym.leq = '{/Symbol \243}'; | |
2362 sym.infty = '{/Symbol \245}'; | |
2363 sym.clubsuit = '{/Symbol \247}'; | |
2364 sym.diamondsuit = '{/Symbol \250}'; | |
2365 sym.heartsuit = '{/Symbol \251}'; | |
2366 sym.spadesuit = '{/Symbol \252}'; | |
2367 sym.leftrightarrow = '{/Symbol \253}'; | |
2368 sym.leftarrow = '{/Symbol \254}'; | |
2369 sym.uparrow = '{/Symbol \255}'; | |
2370 sym.rightarrow = '{/Symbol \256}'; | |
2371 sym.downarrow = '{/Symbol \257}'; | |
2372 sym.circ = '{/Symbol \260}'; | |
2373 sym.pm = '{/Symbol \261}'; | |
2374 sym.geq = '{/Symbol \263}'; | |
2375 sym.times = '{/Symbol \264}'; | |
2376 sym.propto = '{/Symbol \265}'; | |
2377 sym.partial = '{/Symbol \266}'; | |
2378 sym.bullet = '{/Symbol \267}'; | |
2379 sym.div = '{/Symbol \270}'; | |
2380 sym.neq = '{/Symbol \271}'; | |
2381 sym.equiv = '{/Symbol \272}'; | |
2382 sym.approx = '{/Symbol \273}'; | |
2383 sym.ldots = '{/Symbol \274}'; | |
2384 sym.mid = '{/Symbol \275}'; | |
2385 sym.aleph = '{/Symbol \300}'; | |
2386 sym.Im = '{/Symbol \301}'; | |
2387 sym.Re = '{/Symbol \302}'; | |
2388 sym.wp = '{/Symbol \303}'; | |
2389 sym.otimes = '{/Symbol \304}'; | |
2390 sym.oplus = '{/Symbol \305}'; | |
2391 sym.oslash = '{/Symbol \306}'; | |
2392 sym.cap = '{/Symbol \307}'; | |
2393 sym.cup = '{/Symbol \310}'; | |
2394 sym.supset = '{/Symbol \311}'; | |
2395 sym.supseteq = '{/Symbol \312}'; | |
2396 sym.subset = '{/Symbol \314}'; | |
2397 sym.subseteq = '{/Symbol \315}'; | |
2398 sym.in = '{/Symbol \316}'; | |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2399 sym.notin = '{/Symbol \317}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2400 sym.angle = '{/Symbol \320}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2401 sym.bigtriangledown = '{/Symbol \321}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2402 sym.langle = '{/Symbol \341}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2403 sym.rangle = '{/Symbol \361}'; |
7189 | 2404 sym.nabla = '{/Symbol \321}'; |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2405 sym.prod = '{/Symbol \325}'; |
7189 | 2406 sym.surd = '{/Symbol \326}'; |
2407 sym.cdot = '{/Symbol \327}'; | |
2408 sym.neg = '{/Symbol \330}'; | |
2409 sym.wedge = '{/Symbol \331}'; | |
2410 sym.vee = '{/Symbol \332}'; | |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2411 sym.Leftrightarrow = '{/Symbol \333}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2412 sym.Leftarrow = '{/Symbol \334}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2413 sym.Uparrow = '{/Symbol \335}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2414 sym.Rightarrow = '{/Symbol \336}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2415 sym.Downarrow = '{/Symbol \337}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2416 sym.diamond = '{/Symbol \340}'; |
7189 | 2417 sym.copyright = '{/Symbol \343}'; |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2418 sym.lfloor = '{/Symbol \353}'; |
7189 | 2419 sym.lceil = '{/Symbol \351}'; |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
2420 sym.rfloor = '{/Symbol \373}'; |
7189 | 2421 sym.rceil = '{/Symbol \371}'; |
2422 sym.int = '{/Symbol \362}'; | |
2423 endfunction | |
2424 | |
7390 | 2425 function retval = __do_enhanced_option__ (enhanced, obj) |
2426 retval = ""; | |
2427 if (enhanced) | |
2428 if (strcmpi (obj.interpreter, "none")) | |
2429 retval = "noenhanced"; | |
2430 else | |
2431 retval = "enhanced"; | |
2432 endif | |
2433 endif | |
2434 endfunction |