Mercurial > hg > octave-lyh
annotate scripts/plot/__go_draw_axes__.m @ 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".
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Wed, 11 Mar 2009 00:39:02 -0400 |
parents | 4a312440b262 |
children | e15f4197d907 |
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 | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
26 function __go_draw_axes__ (h, plot_stream, enhanced, mono, implicit_margin) |
6405 | 27 |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
28 if (nargin >= 4 && nargin <= 5) |
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); |
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
|
34 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
|
35 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
|
36 end_unwind_protect |
6405 | 37 |
38 parent_figure_obj = get (axis_obj.parent); | |
39 | |
8208 | 40 ## Set to false for plotyy axes. |
41 if (strcmp (axis_obj.tag, "plotyy")) | |
8102 | 42 ymirror = false; |
8208 | 43 else |
44 ymirror = true; | |
7189 | 45 endif |
46 | |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
47 nd = __calc_dimensions__ (axis_obj); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
48 pos = axis_obj.position; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
49 pos = pos - implicit_margin([1, 2, 1, 2]).*[1, 1, -0.5, -0.5]; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
50 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
51 if (strcmpi (axis_obj.dataaspectratiomode, "manual")) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
52 pos = __actual_axis_position__ (axis_obj); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
53 endif |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
54 if (nd == 2) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
55 x = [1, 1]; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
56 else |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
57 ## 3D plots need to be sized down to fit in the window. |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
58 x = 1.0 ./ sqrt([2, 2.5]); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
59 endif |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
60 fprintf (plot_stream, "set tmargin screen %.15g;\n", pos(2)+pos(4)/2+x(2)*pos(4)/2); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
61 fprintf (plot_stream, "set bmargin screen %.15g;\n", pos(2)+pos(4)/2-x(2)*pos(4)/2); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
62 fprintf (plot_stream, "set lmargin screen %.15g;\n", pos(1)+pos(3)/2-x(1)*pos(3)/2); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
63 fprintf (plot_stream, "set rmargin screen %.15g;\n", pos(1)+pos(3)/2+x(1)*pos(3)/2); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
64 else |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
65 ## FIXME -- nothing should change for gnuplot 4.2.x. |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
66 fprintf (plot_stream, "set tmargin 0;\n"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
67 fprintf (plot_stream, "set bmargin 0;\n"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
68 fprintf (plot_stream, "set lmargin 0;\n"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
69 fprintf (plot_stream, "set rmargin 0;\n"); |
7189 | 70 |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
71 fprintf (plot_stream, "set origin %.15g, %.15g;\n", pos(1), pos(2)); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
72 fprintf (plot_stream, "set size %.15g, %.15g;\n", pos(3), pos(4)); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
73 |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
74 if (strcmpi (axis_obj.dataaspectratiomode, "manual")) |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
75 r = axis_obj.dataaspectratio; |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
76 fprintf (plot_stream, "set size ratio %.15g;\n", -r(2)/r(1)); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
77 else |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
78 fputs (plot_stream, "set size noratio;\n"); |
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
79 endif |
6405 | 80 endif |
81 | |
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
|
82 ## 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
|
83 ## 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
|
84 ## Presently, this is dispersed in this function. |
6778 | 85 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
|
86 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
|
87 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
|
88 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
|
89 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
|
90 fputs (plot_stream, "unset x2tics;\n"); |
6778 | 91 |
6405 | 92 if (! isempty (axis_obj.title)) |
93 t = get (axis_obj.title); | |
94 if (isempty (t.string)) | |
95 fputs (plot_stream, "unset title;\n"); | |
96 else | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
97 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
7257 | 98 if (strcmp (f, "*")) |
99 fontspec = ""; | |
100 else | |
101 fontspec = sprintf ("font \"%s,%d\"", f, s); | |
102 endif | |
7390 | 103 fprintf (plot_stream, "set title \"%s\" %s %s;\n", |
104 undo_string_escapes (tt), fontspec, | |
105 __do_enhanced_option__ (enhanced, t)); | |
6405 | 106 endif |
107 endif | |
108 | |
109 if (! isempty (axis_obj.xlabel)) | |
110 t = get (axis_obj.xlabel); | |
6737 | 111 angle = t.rotation; |
7269 | 112 colorspec = get_text_colorspec (axis_obj.xcolor, mono); |
6405 | 113 if (isempty (t.string)) |
7194 | 114 fprintf (plot_stream, "unset xlabel;\n"); |
115 fprintf (plot_stream, "unset x2label;\n"); | |
6405 | 116 else |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
117 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
7257 | 118 if (strcmp (f, "*")) |
119 fontspec = ""; | |
120 else | |
121 fontspec = sprintf ("font \"%s,%d\"", f, s); | |
122 endif | |
7194 | 123 if (strcmpi (axis_obj.xaxislocation, "top")) |
7390 | 124 fprintf (plot_stream, "set x2label \"%s\" %s %s %s", |
125 undo_string_escapes (tt), colorspec, fontspec, | |
126 __do_enhanced_option__ (enhanced, t)); | |
7194 | 127 else |
7390 | 128 fprintf (plot_stream, "set xlabel \"%s\" %s %s %s", |
129 undo_string_escapes (tt), colorspec, fontspec, | |
130 __do_enhanced_option__ (enhanced, t)); | |
7194 | 131 endif |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
132 fprintf (plot_stream, " rotate by %f;\n", angle); |
7194 | 133 if (strcmpi (axis_obj.xaxislocation, "top")) |
134 fprintf (plot_stream, "unset xlabel;\n"); | |
135 else | |
136 fprintf (plot_stream, "unset x2label;\n"); | |
137 endif | |
6405 | 138 endif |
139 endif | |
140 | |
141 if (! isempty (axis_obj.ylabel)) | |
142 t = get (axis_obj.ylabel); | |
6737 | 143 angle = t.rotation; |
7269 | 144 colorspec = get_text_colorspec (axis_obj.ycolor, mono); |
6405 | 145 if (isempty (t.string)) |
7194 | 146 fprintf (plot_stream, "unset ylabel;\n"); |
147 fprintf (plot_stream, "unset y2label;\n"); | |
6405 | 148 else |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
149 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
7257 | 150 if (strcmp (f, "*")) |
151 fontspec = ""; | |
152 else | |
153 fontspec = sprintf ("font \"%s,%d\"", f, s); | |
154 endif | |
7194 | 155 if (strcmpi (axis_obj.yaxislocation, "right")) |
7390 | 156 fprintf (plot_stream, "set y2label \"%s\" %s %s %s", |
157 undo_string_escapes (tt), colorspec, fontspec, | |
158 __do_enhanced_option__ (enhanced, t)); | |
7194 | 159 else |
7390 | 160 fprintf (plot_stream, "set ylabel \"%s\" %s %s %s", |
161 undo_string_escapes (tt), colorspec, fontspec, | |
162 __do_enhanced_option__ (enhanced, t)); | |
7194 | 163 endif |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
164 fprintf (plot_stream, " rotate by %f;\n", angle); |
7194 | 165 if (strcmpi (axis_obj.yaxislocation, "right")) |
166 fprintf (plot_stream, "unset ylabel;\n"); | |
167 else | |
168 fprintf (plot_stream, "unset y2label;\n"); | |
169 endif | |
6405 | 170 endif |
171 endif | |
172 | |
173 if (! isempty (axis_obj.zlabel)) | |
174 t = get (axis_obj.zlabel); | |
6737 | 175 angle = t.rotation; |
7269 | 176 colorspec = get_text_colorspec (axis_obj.zcolor, mono); |
6405 | 177 if (isempty (t.string)) |
178 fputs (plot_stream, "unset zlabel;\n"); | |
179 else | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
180 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
7257 | 181 if (strcmp (f, "*")) |
182 fontspec = ""; | |
183 else | |
184 fontspec = sprintf ("font \"%s,%d\"", f, s); | |
185 endif | |
7390 | 186 fprintf (plot_stream, "set zlabel \"%s\" %s %s %s", |
187 undo_string_escapes (tt), colorspec, fontspec, | |
188 __do_enhanced_option__ (enhanced, t)); | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
189 fprintf (plot_stream, " rotate by %f;\n", angle); |
6405 | 190 endif |
191 endif | |
192 | |
6809 | 193 if (strcmpi (axis_obj.xaxislocation, "top")) |
194 xaxisloc = "x2"; | |
195 xaxisloc_using = "x2"; | |
196 else | |
197 xaxisloc = "x"; | |
198 xaxisloc_using = "x1"; | |
7321 | 199 if (strcmpi (axis_obj.xaxislocation, "zero")) |
200 fputs (plot_stream, "set xzeroaxis;\n"); | |
201 endif | |
6809 | 202 endif |
203 if (strcmpi (axis_obj.yaxislocation, "right")) | |
204 yaxisloc = "y2"; | |
205 yaxisloc_using = "y2"; | |
206 else | |
207 yaxisloc = "y"; | |
208 yaxisloc_using = "y1"; | |
7321 | 209 if (strcmpi (axis_obj.yaxislocation, "zero")) |
210 fputs (plot_stream, "set yzeroaxis;\n"); | |
211 endif | |
6809 | 212 endif |
213 | |
7274 | 214 have_grid = false; |
215 | |
6758 | 216 if (strcmpi (axis_obj.xgrid, "on")) |
7274 | 217 have_grid = true; |
6809 | 218 fprintf (plot_stream, "set grid %stics;\n", xaxisloc); |
6405 | 219 else |
6809 | 220 fprintf (plot_stream, "set grid no%stics;\n", xaxisloc); |
6405 | 221 endif |
222 | |
6758 | 223 if (strcmpi (axis_obj.ygrid, "on")) |
7274 | 224 have_grid = true; |
6809 | 225 fprintf (plot_stream, "set grid %stics;\n", yaxisloc); |
6405 | 226 else |
6809 | 227 fprintf (plot_stream, "set grid no%stics;\n", yaxisloc); |
6405 | 228 endif |
229 | |
6758 | 230 if (strcmpi (axis_obj.zgrid, "on")) |
7274 | 231 have_grid = true; |
6405 | 232 fputs (plot_stream, "set grid ztics;\n"); |
233 else | |
7085 | 234 fputs (plot_stream, "set grid noztics;\n"); |
6405 | 235 endif |
236 | |
6758 | 237 if (strcmpi (axis_obj.xminorgrid, "on")) |
7274 | 238 have_grid = true; |
6809 | 239 fprintf (plot_stream, "set m%stics 5;\n", xaxisloc); |
240 fprintf (plot_stream, "set grid m%stics;\n", xaxisloc); | |
6405 | 241 else |
6809 | 242 fprintf (plot_stream, "set grid nom%stics;\n", xaxisloc); |
6405 | 243 endif |
244 | |
6758 | 245 if (strcmpi (axis_obj.yminorgrid, "on")) |
7274 | 246 have_grid = true; |
6809 | 247 fprintf (plot_stream, "set m%stics 5;\n", yaxisloc); |
248 fprintf (plot_stream, "set grid m%stics;\n", yaxisloc); | |
6405 | 249 else |
6809 | 250 fprintf (plot_stream, "set grid nom%stics;\n", yaxisloc); |
6405 | 251 endif |
252 | |
6758 | 253 if (strcmpi (axis_obj.zminorgrid, "on")) |
7274 | 254 have_grid = true; |
6405 | 255 fputs (plot_stream, "set mztics 5;\n"); |
256 fputs (plot_stream, "set grid mztics;\n"); | |
257 else | |
258 fputs (plot_stream, "set grid nomztics;\n"); | |
259 endif | |
260 | |
7307 | 261 ## The grid front/back/layerdefault option also controls the |
262 ## appearance of tics, so it is used even if the grid is absent. | |
263 if (strcmpi (axis_obj.layer, "top")) | |
264 fputs (plot_stream, "set grid front;\n"); | |
265 else | |
266 fputs (plot_stream, "set grid layerdefault;\n"); | |
267 endif | |
7297 | 268 if (! have_grid) |
269 fputs (plot_stream, "unset grid;\n"); | |
7274 | 270 endif |
271 | |
7269 | 272 do_tics (axis_obj, plot_stream, ymirror, mono); |
6405 | 273 |
6758 | 274 xlogscale = strcmpi (axis_obj.xscale, "log"); |
6405 | 275 if (xlogscale) |
6809 | 276 fprintf (plot_stream, "set logscale %s;\n", xaxisloc); |
6405 | 277 else |
6809 | 278 fprintf (plot_stream, "unset logscale %s;\n", xaxisloc); |
6405 | 279 endif |
280 | |
6758 | 281 ylogscale = strcmpi (axis_obj.yscale, "log"); |
6405 | 282 if (ylogscale) |
6809 | 283 fprintf (plot_stream, "set logscale %s;\n", yaxisloc); |
6405 | 284 else |
6809 | 285 fprintf (plot_stream, "unset logscale %s;\n", yaxisloc); |
6405 | 286 endif |
287 | |
6758 | 288 zlogscale = strcmpi (axis_obj.zscale, "log"); |
6405 | 289 if (zlogscale) |
290 fputs (plot_stream, "set logscale z;\n"); | |
291 else | |
292 fputs (plot_stream, "unset logscale z;\n"); | |
293 endif | |
294 | |
6758 | 295 xautoscale = strcmpi (axis_obj.xlimmode, "auto"); |
296 yautoscale = strcmpi (axis_obj.ylimmode, "auto"); | |
297 zautoscale = strcmpi (axis_obj.zlimmode, "auto"); | |
7109 | 298 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
|
299 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
|
300 truecolor = false; |
6405 | 301 |
8360
32d9c0299e99
Set gnuplot two point clipping
David Bateman <dbateman@free.fr>
parents:
8354
diff
changeset
|
302 fputs (plot_stream, "set clip two;\n"); |
32d9c0299e99
Set gnuplot two point clipping
David Bateman <dbateman@free.fr>
parents:
8354
diff
changeset
|
303 |
6405 | 304 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
|
305 ## 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
|
306 ## 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
|
307 [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
|
308 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
|
309 kids = kids (sort (k)); |
6405 | 310 |
7316 | 311 if (nd == 3) |
312 fputs (plot_stream, "set parametric;\n"); | |
313 fputs (plot_stream, "set style data lines;\n"); | |
314 fputs (plot_stream, "set surface;\n"); | |
315 fputs (plot_stream, "unset contour;\n"); | |
316 endif | |
317 | |
6405 | 318 data_idx = 0; |
319 data = cell (); | |
6464 | 320 is_image_data = []; |
7175 | 321 hidden_removal = NaN; |
7271 | 322 view_map = false; |
6405 | 323 |
7223 | 324 xlim = axis_obj.xlim; |
325 ylim = axis_obj.ylim; | |
326 zlim = axis_obj.zlim; | |
327 clim = axis_obj.clim; | |
6405 | 328 |
7222 | 329 if (! cautoscale && clim(1) == clim(2)) |
330 clim(2)++; | |
7189 | 331 endif |
332 | |
6405 | 333 [view_cmd, view_fcn, view_zoom] = image_viewer (); |
334 use_gnuplot_for_images = (ischar (view_fcn) | |
7583
1d7c23e288d7
__go_draw_axes__: use strcmpi for text properties; use get for hidden properties
John W. Eaton <jwe@octave.org>
parents:
7582
diff
changeset
|
335 && strcmpi (view_fcn, "gnuplot_internal")); |
6405 | 336 |
337 ximg_data = {}; | |
338 ximg_data_idx = 0; | |
339 | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
340 while (! isempty (kids)) |
6405 | 341 |
8344
b5f10b123440
__go_draw_axes__.m: Correct order for rendering children.
Ben Abbott <bpabbott@mac.com>
parents:
8322
diff
changeset
|
342 obj = get (kids(end)); |
b5f10b123440
__go_draw_axes__.m: Correct order for rendering children.
Ben Abbott <bpabbott@mac.com>
parents:
8322
diff
changeset
|
343 kids = kids(1:(end-1)); |
6405 | 344 |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
345 if (strcmpi (obj.visible, "off")) |
8052
961d4c52ffae
Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents:
8048
diff
changeset
|
346 continue; |
961d4c52ffae
Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents:
8048
diff
changeset
|
347 endif |
961d4c52ffae
Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents:
8048
diff
changeset
|
348 |
8171
15ffb9836c01
__go_draw_axes__.m: Remove depdenence on gnuplot version.
Ben Abbott <bpabbott@mac.com>
parents:
8166
diff
changeset
|
349 ## 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
|
350 doing_interp_color = ... |
15ffb9836c01
__go_draw_axes__.m: Remove depdenence on gnuplot version.
Ben Abbott <bpabbott@mac.com>
parents:
8166
diff
changeset
|
351 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
|
352 |
6405 | 353 switch (obj.type) |
354 case "image" | |
355 img_data = obj.cdata; | |
356 img_xdata = obj.xdata; | |
357 img_ydata = obj.ydata; | |
358 | |
359 if (use_gnuplot_for_images) | |
360 | |
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
|
361 if (ndims (img_data) == 3) |
1f6eb3de1c4e
__img__.m, imshow.m, __go_draw_axes__.m: improve handling of truecolor images
John W. Eaton <jwe@octave.org>
parents:
7873
diff
changeset
|
362 truecolor = true; |
1f6eb3de1c4e
__img__.m, imshow.m, __go_draw_axes__.m: improve handling of truecolor images
John W. Eaton <jwe@octave.org>
parents:
7873
diff
changeset
|
363 elseif (strcmpi (obj.cdatamapping, "direct")) |
7471
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
364 cdatadirect = true; |
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
365 endif |
7271 | 366 fputs (plot_stream, "set border front;\n"); |
6405 | 367 data_idx++; |
6464 | 368 is_image_data(data_idx) = true; |
6861 | 369 parametric(data_idx) = false; |
7119 | 370 have_cdata(data_idx) = false; |
6405 | 371 |
372 [y_dim, x_dim] = size (img_data(:,:,1)); | |
373 if (x_dim > 1) | |
374 dx = abs (img_xdata(2)-img_xdata(1))/(x_dim-1); | |
375 else | |
8208 | 376 x_dim = 2; |
377 img_data = [img_data, img_data]; | |
378 dx = abs (img_xdata(2)-img_xdata(1)); | |
6405 | 379 endif |
380 if (y_dim > 1) | |
381 dy = abs (img_ydata(2)-img_ydata(1))/(y_dim-1); | |
382 else | |
8208 | 383 y_dim = 2; |
384 img_data = [img_data; img_data]; | |
385 dy = abs (img_ydata(2)-img_ydata(1)); | |
6405 | 386 endif |
387 x_origin = min (img_xdata); | |
388 y_origin = min (img_ydata); | |
389 | |
390 if (ndims (img_data) == 3) | |
6464 | 391 data{data_idx} = permute (img_data, [3, 1, 2])(:); |
6405 | 392 format = "1:2:3"; |
393 imagetype = "rgbimage"; | |
394 else | |
6464 | 395 data{data_idx} = img_data(:); |
6405 | 396 format = "1"; |
397 imagetype = "image"; | |
398 endif | |
399 | |
6579 | 400 titlespec{data_idx} = "title \"\""; |
6914 | 401 usingclause{data_idx} = sprintf ("binary array=%dx%d scan=yx origin=(%.15g,%.15g) dx=%.15g dy=%.15g using %s", |
6405 | 402 x_dim, y_dim, x_origin, y_origin, dx, dy, format); |
403 withclause{data_idx} = sprintf ("with %s", imagetype); | |
404 | |
405 else | |
406 ximg_data{++ximg_data_idx} = img_data; | |
407 endif | |
408 | |
409 case "line" | |
7120 | 410 if (strncmp (obj.linestyle, "none", 4) |
411 && (! isfield (obj, "marker") | |
412 || (isfield (obj, "marker") | |
413 && strncmp (obj.marker, "none", 4)))) | |
414 continue; | |
415 endif | |
6405 | 416 data_idx++; |
6464 | 417 is_image_data(data_idx) = false; |
6861 | 418 parametric(data_idx) = true; |
7119 | 419 have_cdata(data_idx) = false; |
6405 | 420 if (isempty (obj.keylabel)) |
421 titlespec{data_idx} = "title \"\""; | |
422 else | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
423 tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "keylabel")); |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
424 titlespec{data_idx} = cstrcat ("title \"", tmp, "\""); |
6405 | 425 endif |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
426 usingclause{data_idx} = sprintf ("record=%d", numel (obj.xdata)); |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
427 errbars = ""; |
7316 | 428 if (nd == 3) |
6405 | 429 xdat = obj.xdata(:); |
430 ydat = obj.ydata(:); | |
7316 | 431 if (! isempty (obj.zdata)) |
432 zdat = obj.zdata(:); | |
433 else | |
434 zdat = zeros (size (xdat)); | |
435 endif | |
6405 | 436 data{data_idx} = [xdat, ydat, zdat]'; |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
437 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3)", numel (xdat)); |
7316 | 438 ## fputs (plot_stream, "set parametric;\n"); |
6405 | 439 else |
440 xdat = obj.xdata(:); | |
441 ydat = obj.ydata(:); | |
442 ldat = obj.ldata; | |
443 yerr = xerr = false; | |
444 if (! isempty (ldat)) | |
445 yerr = true; | |
446 ldat = ldat(:); | |
447 endif | |
448 udat = obj.udata; | |
449 if (! isempty (udat)) | |
450 udat = udat(:); | |
451 endif | |
452 xldat = obj.xldata; | |
453 if (! isempty (xldat)) | |
454 xerr = true; | |
455 xldat = xldat(:); | |
456 endif | |
457 xudat = obj.xudata; | |
458 if (! isempty (xudat)) | |
459 xudat = xudat(:); | |
460 endif | |
461 if (yerr) | |
7213 | 462 if (isempty (ldat)) |
463 ylo = ydat; | |
464 else | |
465 ylo = ydat-ldat; | |
466 endif | |
467 if (isempty (udat)) | |
468 yhi = ydat; | |
469 else | |
470 yhi = ydat+udat; | |
471 endif | |
6405 | 472 if (xerr) |
7213 | 473 if (isempty (xldat)) |
474 xlo = xdat; | |
475 else | |
476 xlo = xdat-xldat; | |
477 endif | |
478 if (isempty (xudat)) | |
479 xhi = xdat; | |
480 else | |
481 xhi = xdat+xudat; | |
482 endif | |
6405 | 483 data{data_idx} = [xdat, ydat, xlo, xhi, ylo, yhi]'; |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
484 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3):($4):($5):($6)", numel (xdat)); |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
485 errbars = "xyerrorbars"; |
6405 | 486 else |
487 data{data_idx} = [xdat, ydat, ylo, yhi]'; | |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
488 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3):($4)", numel (xdat)); |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
489 errbars = "yerrorbars"; |
6405 | 490 endif |
491 elseif (xerr) | |
7236 | 492 if (isempty (xldat)) |
493 xlo = xdat; | |
494 else | |
495 xlo = xdat-xldat; | |
496 endif | |
497 if (isempty (xudat)) | |
498 xhi = xdat; | |
499 else | |
500 xhi = xdat+xudat; | |
501 endif | |
6405 | 502 data{data_idx} = [xdat, ydat, xlo, xhi]'; |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
503 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3):($4)", numel (xdat)); |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
504 errbars = "xerrorbars"; |
6405 | 505 else |
506 data{data_idx} = [xdat, ydat]'; | |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
507 usingclause{data_idx} = sprintf ("record=%d using ($1):($2) axes %s%s", |
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
508 rows(xdat), xaxisloc_using, yaxisloc_using); |
6405 | 509 endif |
510 endif | |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
511 |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
512 [style, typ, with] = do_linestyle_command (obj, data_idx, mono, |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
513 plot_stream, errbars); |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
514 |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
515 withclause{data_idx} = sprintf ("with %s linestyle %d", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
516 style, data_idx); |
6405 | 517 |
6790 | 518 case "patch" |
6885 | 519 cmap = parent_figure_obj.colormap; |
7020 | 520 [nr, nc] = size (obj.xdata); |
521 | |
7189 | 522 if (! isempty (obj.cdata)) |
523 cdat = obj.cdata; | |
7583
1d7c23e288d7
__go_draw_axes__: use strcmpi for text properties; use get for hidden properties
John W. Eaton <jwe@octave.org>
parents:
7582
diff
changeset
|
524 if (strcmpi (obj.cdatamapping, "direct")) |
7471
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
525 cdatadirect = true; |
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
526 endif |
7189 | 527 else |
528 cdat = []; | |
529 endif | |
530 | |
7170 | 531 for i = 1:nc |
7020 | 532 xcol = obj.xdata(:,i); |
533 ycol = obj.ydata(:,i); | |
7316 | 534 if (nd == 3) |
535 if (! isempty (obj.zdata)) | |
536 zcol = obj.zdata(:,i); | |
537 else | |
538 zcol = zeros (size (xcol)); | |
539 endif | |
7170 | 540 endif |
7020 | 541 |
542 if (! isnan (xcol) && ! isnan (ycol)) | |
543 ## Is the patch closed or not | |
7175 | 544 if (strncmp (obj.facecolor, "none", 4)) |
7318 | 545 hidden_removal = false; |
546 else | |
7175 | 547 if (isnan (hidden_removal)) |
7318 | 548 hidden_removal = true; |
7175 | 549 endif |
7316 | 550 if (nd == 3) |
7170 | 551 error ("gnuplot (as of v4.2) only supports 2D filled patches"); |
552 endif | |
553 | |
554 data_idx++; | |
555 is_image_data(data_idx) = false; | |
556 parametric(data_idx) = false; | |
557 have_cdata(data_idx) = false; | |
558 if (i > 1 || isempty (obj.keylabel)) | |
559 titlespec{data_idx} = "title \"\""; | |
560 else | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
561 tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "keylabel")); |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
562 titlespec{data_idx} = cstrcat ("title \"", tmp, "\""); |
7170 | 563 endif |
7189 | 564 if (isfield (obj, "facecolor")) |
565 if ((strncmp (obj.facecolor, "flat", 4) | |
7284 | 566 || strncmp (obj.facecolor, "interp", 6)) |
567 && isfield (obj, "cdata")) | |
7170 | 568 if (ndims (obj.cdata) == 2 |
7189 | 569 && (size (obj.cdata, 2) == nc |
570 && (size (obj.cdata, 1) == 1 | |
571 || size (obj.cdata, 1) == 3))) | |
572 ccol = cdat (:, i); | |
573 elseif (ndims (obj.cdata) == 2 | |
574 && (size (obj.cdata, 1) == nc | |
575 && (size (obj.cdata, 2) == 1 | |
576 || size (obj.cdata, 2) == 3))) | |
577 ccol = cdat (i, :); | |
7170 | 578 elseif (ndims (obj.cdata) == 3) |
7189 | 579 ccol = permute (cdat (:, i, :), [1, 3, 2]); |
7170 | 580 else |
7189 | 581 ccol = cdat; |
7170 | 582 endif |
583 if (strncmp (obj.facecolor, "flat", 4)) | |
584 if (numel(ccol) == 3) | |
585 color = ccol; | |
586 else | |
7226 | 587 r = 1 + round ((size (cmap, 1) - 1) |
588 * (ccol - clim(1))/(clim(2) - clim(1))); | |
7170 | 589 r = max (1, min (r, size (cmap, 1))); |
590 color = cmap(r, :); | |
591 endif | |
592 elseif (strncmp (obj.facecolor, "interp", 6)) | |
7582 | 593 warning ("\"interp\" not supported, using 1st entry of cdata"); |
7170 | 594 r = 1 + round ((size (cmap, 1) - 1) * ccol(1)); |
595 r = max (1, min (r, size (cmap, 1))); | |
596 color = cmap(r,:); | |
597 endif | |
7189 | 598 elseif (isnumeric (obj.facecolor)) |
599 color = obj.facecolor; | |
7170 | 600 else |
7189 | 601 color = [0, 1, 0]; |
7170 | 602 endif |
603 else | |
604 color = [0, 1, 0]; | |
605 endif | |
606 | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
607 if (mono) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
608 colorspec = ""; |
8633 | 609 elseif (__gnuplot_has_feature__ ("transparent_patches") |
610 && isscalar (obj.facealpha)) | |
611 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\" fillstyle transparent solid %f", | |
612 round (255*color), obj.facealpha); | |
7170 | 613 else |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
614 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
615 round (255*color)); |
7170 | 616 endif |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
617 withclause{data_idx} = sprintf ("with filledcurve %s", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
618 colorspec); |
7170 | 619 data{data_idx} = [xcol, ycol]'; |
8633 | 620 usingclause{data_idx} = sprintf ("record=%d using ($1):($2)", |
621 numel (xcol)); | |
7170 | 622 endif |
623 endif | |
624 | |
625 ## patch outline | |
626 if (! strncmp (obj.edgecolor, "none", 4)) | |
627 | |
628 data_idx++; | |
629 is_image_data(data_idx) = false; | |
630 parametric(data_idx) = false; | |
631 have_cdata(data_idx) = false; | |
632 titlespec{data_idx} = "title \"\""; | |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
633 usingclause{data_idx} = sprintf ("record=%d", numel (obj.xdata)); |
7189 | 634 |
635 if (isfield (obj, "markersize")) | |
8510
738cb6271933
__go_draw_axes__.m: scale markersize by 1/3 instead of 1/6
John W. Eaton <jwe@octave.org>
parents:
8506
diff
changeset
|
636 mdat = obj.markersize / 3; |
7189 | 637 endif |
638 | |
639 if (isfield (obj, "edgecolor")) | |
640 if ((strncmp (obj.edgecolor, "flat", 4) | |
7284 | 641 || strncmp (obj.edgecolor, "interp", 6)) |
642 && isfield (obj, "cdata")) | |
7119 | 643 if (ndims (obj.cdata) == 2 |
7189 | 644 && (size (obj.cdata, 2) == nc |
645 && (size (obj.cdata, 1) == 1 | |
646 || size (obj.cdata, 1) == 3))) | |
647 ccol = cdat (:, i); | |
648 elseif (ndims (obj.cdata) == 2 | |
649 && (size (obj.cdata, 1) == nc | |
650 && (size (obj.cdata, 2) == 1 | |
651 || size (obj.cdata, 2) == 3))) | |
652 ccol = cdat (i, :); | |
7020 | 653 elseif (ndims (obj.cdata) == 3) |
7189 | 654 ccol = permute (cdat (:, i, :), [1, 3, 2]); |
7020 | 655 else |
7189 | 656 ccol = cdat; |
7020 | 657 endif |
7170 | 658 if (strncmp (obj.edgecolor, "flat", 4)) |
7189 | 659 if (numel(ccol) == 3) |
7020 | 660 color = ccol; |
661 else | |
7226 | 662 r = 1 + round ((size (cmap, 1) - 1) |
663 * (ccol - clim(1))/(clim(2) - clim(1))); | |
7020 | 664 r = max (1, min (r, size (cmap, 1))); |
665 color = cmap(r, :); | |
666 endif | |
7170 | 667 elseif (strncmp (obj.edgecolor, "interp", 6)) |
7582 | 668 warning ("\"interp\" not supported, using 1st entry of cdata"); |
7020 | 669 r = 1 + round ((size (cmap, 1) - 1) * ccol(1)); |
670 r = max (1, min (r, size (cmap, 1))); | |
671 color = cmap(r,:); | |
672 endif | |
7189 | 673 elseif (isnumeric (obj.edgecolor)) |
674 color = obj.edgecolor; | |
675 else | |
676 color = [0, 0, 0]; | |
7020 | 677 endif |
678 else | |
7189 | 679 color = [0, 0, 0]; |
7020 | 680 endif |
7189 | 681 |
682 if (isfield (obj, "linestyle")) | |
683 switch (obj.linestyle) | |
684 case "-" | |
7317 | 685 lt = "lt 1"; |
7189 | 686 case "--" |
7317 | 687 lt = "lt 2"; |
7189 | 688 case ":" |
7317 | 689 lt = "lt 3"; |
7189 | 690 case "-." |
7317 | 691 lt = "lt 6"; |
7189 | 692 case "none" |
693 lt = ""; | |
694 otherwise | |
695 lt = ""; | |
696 endswitch | |
697 else | |
698 lt = ""; | |
699 endif | |
700 | |
7462
dfcaf7ed48e3
Allow linewidth to be specified for contours
David Bateman
parents:
7420
diff
changeset
|
701 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
|
702 lw = sprintf("linewidth %f", obj.linewidth); |
7462
dfcaf7ed48e3
Allow linewidth to be specified for contours
David Bateman
parents:
7420
diff
changeset
|
703 else |
dfcaf7ed48e3
Allow linewidth to be specified for contours
David Bateman
parents:
7420
diff
changeset
|
704 lw = ""; |
dfcaf7ed48e3
Allow linewidth to be specified for contours
David Bateman
parents:
7420
diff
changeset
|
705 endif |
dfcaf7ed48e3
Allow linewidth to be specified for contours
David Bateman
parents:
7420
diff
changeset
|
706 |
7189 | 707 if (isfield (obj, "marker")) |
708 if (isfield (obj, "marker")) | |
709 switch (obj.marker) | |
710 case "+" | |
711 pt = "pt 1"; | |
712 case "o" | |
713 pt = "pt 6"; | |
714 case "*" | |
715 pt = "pt 3"; | |
716 case "." | |
717 pt = "pt 0"; | |
718 case "x" | |
719 pt = "pt 2"; | |
720 case {"square", "s"} | |
721 pt = "pt 5"; | |
722 case {"diamond", "d"} | |
723 pt = "pt 13"; | |
724 case "^" | |
725 pt = "pt 9"; | |
726 case "v" | |
727 pt = "pt 11"; | |
728 case ">" | |
729 pt = "pt 8"; | |
730 case "<" | |
731 pt = "pt 10"; | |
732 case {"pentagram", "p"} | |
733 pt = "pt 4"; | |
734 case {"hexagram", "h"} | |
735 pt = "pt 12"; | |
736 case "none" | |
737 pt = ""; | |
738 otherwise | |
739 pt = ""; | |
740 endswitch | |
741 endif | |
742 else | |
743 pt = ""; | |
744 endif | |
745 | |
746 style = "lines"; | |
747 if (isempty (lt)) | |
748 if (! isempty (pt)) | |
749 style = "points"; | |
750 endif | |
751 elseif (! isempty (pt)) | |
752 style = "linespoints"; | |
753 endif | |
754 | |
755 if (isfield (obj, "markersize")) | |
756 if (length (mdat) == nc) | |
7603
689652eb95d1
fix for scatter markersize
David Bateman <dbateman@free.fr>
parents:
7593
diff
changeset
|
757 m = mdat(i); |
7189 | 758 else |
7603
689652eb95d1
fix for scatter markersize
David Bateman <dbateman@free.fr>
parents:
7593
diff
changeset
|
759 m = mdat; |
7189 | 760 endif |
761 if (! strcmpi (style, "lines")) | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
762 ps = sprintf("pointsize %f", m); |
7189 | 763 else |
764 ps = ""; | |
765 endif | |
766 else | |
767 ps = ""; | |
768 endif | |
769 | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
770 if (mono) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
771 colorspec = ""; |
7020 | 772 else |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
773 colorspec = sprintf ("lc rgb \"#%02x%02x%02x\"", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
774 round (255*color)); |
7020 | 775 endif |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
776 withclause{data_idx} = sprintf ("with %s %s %s %s %s %s", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
777 style, lw, pt, lt, ps, |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
778 colorspec); |
6790 | 779 |
7316 | 780 if (nd == 3) |
7170 | 781 if (! isnan (xcol) && ! isnan (ycol) && ! isnan (zcol)) |
782 data{data_idx} = [[xcol; xcol(1)], [ycol; ycol(1)], ... | |
783 [zcol; zcol(1)]]'; | |
784 else | |
785 data{data_idx} = [xcol, ycol, zcol]'; | |
786 endif | |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
787 usingclause{data_idx} = sprintf ("record=%d using ($1):($2):($3)", columns (data{data_idx})); |
7020 | 788 else |
7170 | 789 if (! isnan (xcol) && ! isnan (ycol)) |
790 data{data_idx} = [[xcol; xcol(1)], [ycol; ycol(1)]]'; | |
791 else | |
792 data{data_idx} = [xcol, ycol]'; | |
793 endif | |
8218
8a5fbd656f55
make previous change work for surface plots
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8217
diff
changeset
|
794 usingclause{data_idx} = sprintf ("record=%d using ($1):($2)", columns (data{data_idx})); |
7020 | 795 endif |
6885 | 796 endif |
7020 | 797 endfor |
6790 | 798 |
6405 | 799 case "surface" |
7271 | 800 view_map = true; |
7110 | 801 if (! (strncmp (obj.edgecolor, "none", 4) |
802 && strncmp (obj.facecolor, "none", 4))) | |
7109 | 803 data_idx++; |
804 is_image_data(data_idx) = false; | |
805 parametric(data_idx) = false; | |
7119 | 806 have_cdata(data_idx) = true; |
7170 | 807 [style, typ, with] = do_linestyle_command (obj, data_idx, |
7269 | 808 mono, plot_stream); |
7109 | 809 if (isempty (obj.keylabel)) |
810 titlespec{data_idx} = "title \"\""; | |
811 else | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
812 tmp = undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "keylabel")); |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
813 titlespec{data_idx} = cstrcat ("title \"", tmp, "\""); |
7109 | 814 endif |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
815 withclause{data_idx} = sprintf ("with pm3d linestyle %d", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
816 data_idx); |
7109 | 817 |
818 xdat = obj.xdata; | |
819 ydat = obj.ydata; | |
820 zdat = obj.zdata; | |
821 cdat = obj.cdata; | |
7110 | 822 |
7109 | 823 err = false; |
824 if (! size_equal(zdat, cdat)) | |
6405 | 825 err = true; |
7109 | 826 endif |
827 if (isvector (xdat) && isvector (ydat) && ismatrix (zdat)) | |
7110 | 828 if (rows (zdat) == length (ydat) |
829 && columns (zdat) == length (xdat)) | |
7109 | 830 [xdat, ydat] = meshgrid (xdat, ydat); |
831 else | |
832 err = true; | |
833 endif | |
834 elseif (ismatrix (xdat) && ismatrix (ydat) && ismatrix (zdat)) | |
7292 | 835 if (! size_equal (xdat, ydat, zdat)) |
7109 | 836 err = true; |
837 endif | |
838 else | |
839 err = true; | |
840 endif | |
841 if (err) | |
842 error ("__go_draw_axes__: invalid grid data"); | |
6405 | 843 endif |
7109 | 844 xlen = columns (zdat); |
845 ylen = rows (zdat); | |
846 if (xlen == columns (xdat) && xlen == columns (ydat) | |
847 && ylen == rows (xdat) && ylen == rows (ydat)) | |
848 len = 4 * xlen; | |
849 zz = zeros (ylen, len); | |
850 k = 1; | |
851 for kk = 1:4:len | |
852 zz(:,kk) = xdat(:,k); | |
853 zz(:,kk+1) = ydat(:,k); | |
854 zz(:,kk+2) = zdat(:,k); | |
855 zz(:,kk+3) = cdat(:,k); | |
856 k++; | |
857 endfor | |
7170 | 858 data{data_idx} = zz.'; |
7109 | 859 endif |
860 | |
8166
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
861 if (doing_interp_color) |
8665
55efd5d71649
__go_draw_axes__.m: __go_draw_axes__.m: Improved gnuplot color interpolation.
Ben Abbott <bpabbott@mac.com>
parents:
8645
diff
changeset
|
862 interp_str = "interpolate 0, 0"; |
8166
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
863 else |
8171
15ffb9836c01
__go_draw_axes__.m: Remove depdenence on gnuplot version.
Ben Abbott <bpabbott@mac.com>
parents:
8166
diff
changeset
|
864 ## No interpolation of facecolors. |
8166
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
865 interp_str = ""; |
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
866 endif |
8242
a9d3b88ea6fb
__go_draw_axes__.m: Fix for binary xfer of suface plots.
Ben Abbott <bpabbott@mac.com>
parents:
8226
diff
changeset
|
867 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
|
868 |
7119 | 869 flat_interp_face = (strncmp (obj.facecolor, "flat", 4) |
870 || strncmp (obj.facecolor, "interp", 6)); | |
871 flat_interp_edge = (strncmp (obj.edgecolor, "flat", 4) | |
872 || strncmp (obj.edgecolor, "interp", 6)); | |
7154 | 873 |
874 facecolor_none_or_white = (strncmp (obj.facecolor, "none", 4) | |
875 || (isnumeric (obj.facecolor) | |
876 && all (obj.facecolor == 1))); | |
7582 | 877 hidden_removal = false; |
7592 | 878 fputs (plot_stream, "set style increment default;\n"); |
7318 | 879 if (flat_interp_edge && facecolor_none_or_white) |
7189 | 880 withclause{data_idx} = "with line palette"; |
7541
6acd0a18a3ee
If FaceColor is none don't use pm3d mode and set linestyle correctly.
kai@linux-pc
parents:
7540
diff
changeset
|
881 fputs (plot_stream, "unset pm3d\n"); |
7582 | 882 if (all (obj.facecolor == 1)) |
7592 | 883 hidden_removal = true; |
7582 | 884 endif |
7541
6acd0a18a3ee
If FaceColor is none don't use pm3d mode and set linestyle correctly.
kai@linux-pc
parents:
7540
diff
changeset
|
885 elseif (facecolor_none_or_white) |
6acd0a18a3ee
If FaceColor is none don't use pm3d mode and set linestyle correctly.
kai@linux-pc
parents:
7540
diff
changeset
|
886 edgecol = obj.edgecolor; |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
887 if (mono) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
888 colorspec = ""; |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
889 else |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
890 colorspec = sprintf ("linecolor rgb \"#%02x%02x%02x\"", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
891 round (255*edgecol)); |
7541
6acd0a18a3ee
If FaceColor is none don't use pm3d mode and set linestyle correctly.
kai@linux-pc
parents:
7540
diff
changeset
|
892 endif |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
893 if (all (obj.facecolor == 1)) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
894 hidden_removal = true; |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
895 endif |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
896 fputs(plot_stream,"unset pm3d;\n"); |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
897 fprintf (plot_stream, |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
898 "set style line %d %s lw %f;\n", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
899 data_idx, colorspec, obj.linewidth); |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
900 fputs(plot_stream,"set style increment user;\n"); |
7541
6acd0a18a3ee
If FaceColor is none don't use pm3d mode and set linestyle correctly.
kai@linux-pc
parents:
7540
diff
changeset
|
901 withclause{data_idx} = sprintf("with line linestyle %d", data_idx); |
7582 | 902 fputs (plot_stream, "unset pm3d\n"); |
7119 | 903 endif |
7109 | 904 |
8166
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
905 if (doing_interp_color) |
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
906 ## "depthorder" interferes with interpolation of colors. |
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
907 dord = "scansautomatic"; |
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
908 else |
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
909 dord = "depthorder"; |
4024fc815f8d
__go_draw_axes__.m: Fix interpolation of facecolors.
Ben Abbott <bpabbott@mac.com>
parents:
8164
diff
changeset
|
910 endif |
7109 | 911 |
7318 | 912 if (flat_interp_face && strncmp (obj.edgecolor, "flat", 4)) |
913 fprintf (plot_stream, "set pm3d explicit at s %s %s corners2color c3;\n", | |
7189 | 914 interp_str, dord); |
7318 | 915 elseif (!facecolor_none_or_white) |
7119 | 916 if (strncmp (obj.edgecolor, "none", 4)) |
8645 | 917 if (__gnuplot_has_feature__ ("transparent_surface") |
918 && isscalar (obj.facealpha)) | |
919 fprintf (plot_stream, | |
920 "set style fill transparent solid %f;\n", | |
921 obj.facealpha); | |
922 endif | |
7318 | 923 fprintf (plot_stream, "set pm3d explicit at s %s corners2color c3;\n", |
7189 | 924 interp_str, dord); |
7109 | 925 else |
7119 | 926 edgecol = obj.edgecolor; |
927 if (ischar (obj.edgecolor)) | |
7542
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
928 edgecol = [0, 0, 0]; |
7119 | 929 endif |
7318 | 930 fprintf (plot_stream, "set pm3d explicit at s hidden3d %d %s %s corners2color c3;\n", |
7189 | 931 data_idx, interp_str, dord); |
7119 | 932 |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
933 if (mono) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
934 colorspec = ""; |
7119 | 935 else |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
936 colorspec = sprintf ("linecolor rgb \"#%02x%02x%02x\"", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
937 round (255*edgecol)); |
7119 | 938 endif |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
939 fprintf (plot_stream, |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
940 "set style line %d %s lw %f;\n", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
941 data_idx, colorspec, obj.linewidth); |
8645 | 942 if (__gnuplot_has_feature__ ("transparent_surface") |
943 && isscalar (obj.facealpha)) | |
944 fprintf (plot_stream, | |
945 "set style fill transparent solid %f;\n", | |
946 obj.facealpha); | |
947 endif | |
7109 | 948 endif |
7119 | 949 endif |
6405 | 950 endif |
951 | |
952 case "text" | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
953 [label, f, s] = __maybe_munge_text__ (enhanced, obj, "string"); |
7257 | 954 if (strcmp (f, "*")) |
955 fontspec = ""; | |
956 else | |
957 fontspec = sprintf ("font \"%s,%d\"", f, s); | |
958 endif | |
6405 | 959 lpos = obj.position; |
960 halign = obj.horizontalalignment; | |
6724 | 961 angle = obj.rotation; |
6752 | 962 units = obj.units; |
6829 | 963 color = obj.color; |
6758 | 964 if (strcmpi (units, "normalized")) |
6752 | 965 units = "graph"; |
966 else | |
967 units = ""; | |
968 endif | |
969 | |
6829 | 970 if (isnumeric (color)) |
7269 | 971 colorspec = get_text_colorspec (color, mono); |
6829 | 972 endif |
973 | |
6405 | 974 if (nd == 3) |
6724 | 975 fprintf (plot_stream, |
7390 | 976 "set label \"%s\" at %s %.15g,%.15g,%.15g %s rotate by %f %s %s front %s;\n", |
7162 | 977 undo_string_escapes (label), units, lpos(1), |
7390 | 978 lpos(2), lpos(3), halign, angle, fontspec, |
979 __do_enhanced_option__ (enhanced, obj), colorspec); | |
6405 | 980 else |
7162 | 981 fprintf (plot_stream, |
7390 | 982 "set label \"%s\" at %s %.15g,%.15g %s rotate by %f %s %s front %s;\n", |
7162 | 983 undo_string_escapes (label), units, |
7390 | 984 lpos(1), lpos(2), halign, angle, fontspec, |
985 __do_enhanced_option__ (enhanced, obj), colorspec); | |
6405 | 986 endif |
987 | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
988 case "hggroup" |
8506 | 989 ## Push group children into the kid list. |
8216
5d6b9311be38
__go_draw_axes__.m: Fix concatenation of handles.
Ben Abbott <bpabbott@mac.com>
parents:
8208
diff
changeset
|
990 if (isempty (kids)) |
5d6b9311be38
__go_draw_axes__.m: Fix concatenation of handles.
Ben Abbott <bpabbott@mac.com>
parents:
8208
diff
changeset
|
991 kids = obj.children; |
5d6b9311be38
__go_draw_axes__.m: Fix concatenation of handles.
Ben Abbott <bpabbott@mac.com>
parents:
8208
diff
changeset
|
992 elseif (! isempty (obj.children)) |
5d6b9311be38
__go_draw_axes__.m: Fix concatenation of handles.
Ben Abbott <bpabbott@mac.com>
parents:
8208
diff
changeset
|
993 kids = [obj.children; kids]; |
5d6b9311be38
__go_draw_axes__.m: Fix concatenation of handles.
Ben Abbott <bpabbott@mac.com>
parents:
8208
diff
changeset
|
994 endif |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
995 |
6405 | 996 otherwise |
997 error ("__go_draw_axes__: unknown object class, %s", | |
998 obj.type); | |
999 endswitch | |
1000 | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1001 endwhile |
6405 | 1002 |
7692
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1003 ## This is need to prevent warnings for rotations in 3D plots, while |
8506 | 1004 ## 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
|
1005 if (nd == 2 || (data_idx > 1 && !view_map)) |
7692
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1006 fputs (plot_stream, "set pm3d implicit;\n"); |
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1007 else |
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1008 fputs (plot_stream, "set pm3d explicit;\n"); |
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1009 endif |
da1f4bc7cbe8
Conditionally set 'set pm3d implicit'
David Bateman <dbateman@free.fr>
parents:
7676
diff
changeset
|
1010 |
7175 | 1011 if (isnan(hidden_removal) || hidden_removal) |
7149 | 1012 fputs (plot_stream, "set hidden3d;\n"); |
1013 else | |
1014 fputs (plot_stream, "unset hidden3d;\n"); | |
1015 endif | |
1016 | |
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
|
1017 have_data = (! (isempty (data) || all (cellfun (@isempty, data)))); |
6405 | 1018 |
8208 | 1019 ## Note we don't use the [xy]2range of gnuplot as we don't use the |
8506 | 1020 ## dual axis plotting features of gnuplot. |
7222 | 1021 if (isempty (xlim)) |
1022 return; | |
6405 | 1023 endif |
6758 | 1024 if (strcmpi (axis_obj.xdir, "reverse")) |
6405 | 1025 xdir = "reverse"; |
1026 else | |
1027 xdir = "noreverse"; | |
1028 endif | |
8208 | 1029 fprintf (plot_stream, "set xrange [%.15e:%.15e] %s;\n", xlim, xdir); |
6405 | 1030 |
7222 | 1031 if (isempty (ylim)) |
1032 return; | |
6405 | 1033 endif |
6758 | 1034 if (strcmpi (axis_obj.ydir, "reverse")) |
6405 | 1035 ydir = "reverse"; |
1036 else | |
1037 ydir = "noreverse"; | |
1038 endif | |
8208 | 1039 fprintf (plot_stream, "set yrange [%.15e:%.15e] %s;\n", ylim, ydir); |
6405 | 1040 |
7119 | 1041 if (nd == 3) |
7222 | 1042 if (isempty (zlim)) |
1043 return; | |
6405 | 1044 endif |
6758 | 1045 if (strcmpi (axis_obj.zdir, "reverse")) |
6405 | 1046 zdir = "reverse"; |
1047 else | |
1048 zdir = "noreverse"; | |
1049 endif | |
8171
15ffb9836c01
__go_draw_axes__.m: Remove depdenence on gnuplot version.
Ben Abbott <bpabbott@mac.com>
parents:
8166
diff
changeset
|
1050 fprintf (plot_stream, "set zrange [%.15e:%.15e] %s;\n", zlim, zdir); |
6405 | 1051 endif |
7110 | 1052 |
7471
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
1053 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
|
1054 cmap_sz = rows(cmap); |
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
|
1055 |
7189 | 1056 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
|
1057 if (truecolor || ! cdatadirect) |
1f6eb3de1c4e
__img__.m, imshow.m, __go_draw_axes__.m: improve handling of truecolor images
John W. Eaton <jwe@octave.org>
parents:
7873
diff
changeset
|
1058 fprintf (plot_stream, "set cbrange [%g:%g];\n", clim); |
1f6eb3de1c4e
__img__.m, imshow.m, __go_draw_axes__.m: improve handling of truecolor images
John W. Eaton <jwe@octave.org>
parents:
7873
diff
changeset
|
1059 else |
7471
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
1060 fprintf (plot_stream, "set cbrange [1:%d];\n", cmap_sz); |
86ba621332ff
Implement cdatamapping and respect to to allow correct image/imagesc rendering
David Bateman <dbateman@free.fr>
parents:
7462
diff
changeset
|
1061 endif |
7189 | 1062 endif |
1063 | |
6758 | 1064 if (strcmpi (axis_obj.box, "on")) |
7119 | 1065 if (nd == 3) |
6405 | 1066 fputs (plot_stream, "set border 4095;\n"); |
1067 else | |
1068 fputs (plot_stream, "set border 431;\n"); | |
1069 endif | |
1070 else | |
7119 | 1071 if (nd == 3) |
6405 | 1072 fputs (plot_stream, "set border 895;\n"); |
1073 else | |
7320 | 1074 if (strcmpi (axis_obj.yaxislocation, "right")) |
7873
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1075 fprintf (plot_stream, "unset ytics; set y2tics %s nomirror\n", |
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1076 axis_obj.tickdir); |
7320 | 1077 if (strcmpi (axis_obj.xaxislocation, "top")) |
7873
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1078 fprintf (plot_stream, "unset xtics; set x2tics %s nomirror\n", |
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1079 axis_obj.tickdir); |
7320 | 1080 fputs (plot_stream, "set border 12;\n"); |
1081 else | |
7873
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1082 fprintf (plot_stream, "unset x2tics; set xtics %s nomirror\n", |
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1083 axis_obj.tickdir); |
7320 | 1084 fputs (plot_stream, "set border 9;\n"); |
1085 endif | |
1086 else | |
7873
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1087 fprintf (plot_stream, "unset y2tics; set ytics %s nomirror\n", |
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1088 axis_obj.tickdir); |
7320 | 1089 if (strcmpi (axis_obj.xaxislocation, "top")) |
7873
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1090 fprintf (plot_stream, "unset xtics; set x2tics %s nomirror\n", |
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1091 axis_obj.tickdir); |
7320 | 1092 fputs (plot_stream, "set border 6;\n"); |
1093 else | |
7873
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1094 fprintf (plot_stream, "unset x2tics; set xtics %s nomirror\n", |
02b590f46a29
correct fputs to fprintf in __go_draw_axes__.m
Jaroslav Hajek <highegg@gmail.com>
parents:
7865
diff
changeset
|
1095 axis_obj.tickdir); |
7320 | 1096 fputs (plot_stream, "set border 3;\n"); |
1097 endif | |
1098 endif | |
6405 | 1099 endif |
1100 endif | |
1101 | |
7060 | 1102 if (strcmpi (axis_obj.visible, "off")) |
1103 fputs (plot_stream, "unset border; unset tics\n"); | |
7565
1e6443ff960f
handle axes linewidth property
John W. Eaton <jwe@octave.org>
parents:
7564
diff
changeset
|
1104 else |
1e6443ff960f
handle axes linewidth property
John W. Eaton <jwe@octave.org>
parents:
7564
diff
changeset
|
1105 fprintf (plot_stream, "set border lw %f;\n", axis_obj.linewidth); |
7060 | 1106 endif |
1107 | |
6758 | 1108 if (strcmpi (axis_obj.key, "on")) |
1109 if (strcmpi (axis_obj.keybox, "on")) | |
6405 | 1110 box = "box"; |
1111 else | |
1112 box = "nobox"; | |
1113 endif | |
8291
53f35799b235
Add support for left/right argument to the legend function
David Bateman <dbateman@free.fr>
parents:
8242
diff
changeset
|
1114 if (strcmpi (axis_obj.keyreverse, "on")) |
53f35799b235
Add support for left/right argument to the legend function
David Bateman <dbateman@free.fr>
parents:
8242
diff
changeset
|
1115 reverse = "reverse"; |
53f35799b235
Add support for left/right argument to the legend function
David Bateman <dbateman@free.fr>
parents:
8242
diff
changeset
|
1116 else |
53f35799b235
Add support for left/right argument to the legend function
David Bateman <dbateman@free.fr>
parents:
8242
diff
changeset
|
1117 reverse = "noreverse"; |
53f35799b235
Add support for left/right argument to the legend function
David Bateman <dbateman@free.fr>
parents:
8242
diff
changeset
|
1118 endif |
6405 | 1119 inout = "inside"; |
6977 | 1120 keypos = axis_obj.keypos; |
1121 if (ischar (keypos)) | |
1122 keypos = lower (keypos); | |
1123 keyout = findstr (keypos, "outside"); | |
1124 if (! isempty (keyout)) | |
1125 inout = "outside"; | |
7119 | 1126 keypos = keypos(1:keyout-1); |
6977 | 1127 endif |
1128 endif | |
1129 switch (keypos) | |
6405 | 1130 case -1 |
6977 | 1131 pos = "right top"; |
6405 | 1132 inout = "outside"; |
1133 case 1 | |
1134 pos = "right top"; | |
1135 case 2 | |
1136 pos = "left top"; | |
1137 case 3 | |
1138 pos = "left bottom"; | |
6977 | 1139 case {4, 0} |
6405 | 1140 pos = "right bottom"; |
6977 | 1141 case "north" |
1142 pos = "center top"; | |
1143 case "south" | |
1144 pos = "center bottom"; | |
1145 case "east" | |
1146 pos = "right center"; | |
1147 case "west" | |
1148 pos = "left center"; | |
1149 case "northeast" | |
1150 pos = "right top"; | |
1151 case "northwest" | |
1152 pos = "left top"; | |
1153 case "southeast" | |
1154 pos = "right bottom"; | |
1155 case "southwest" | |
1156 pos = "left bottom"; | |
1157 case "best" | |
1158 pos = ""; | |
1159 warning ("legend: 'Best' not yet implemented for location specifier.\n"); | |
8506 | 1160 ## Least conflict with data in plot. |
1161 ## Least unused space outside plot. | |
6405 | 1162 otherwise |
1163 pos = ""; | |
1164 endswitch | |
8291
53f35799b235
Add support for left/right argument to the legend function
David Bateman <dbateman@free.fr>
parents:
8242
diff
changeset
|
1165 fprintf (plot_stream, "set key %s %s %s %s;\n", inout, pos, box, reverse); |
6405 | 1166 else |
1167 fputs (plot_stream, "unset key;\n"); | |
1168 endif | |
1169 | |
1170 fputs (plot_stream, "set style data lines;\n"); | |
1171 | |
1172 if (! use_gnuplot_for_images) | |
1173 for i = 1:ximg_data_idx | |
1174 view_fcn (xlim, ylim, ximg_data{i}, view_zoom, view_cmd); | |
1175 endfor | |
1176 endif | |
1177 | |
7189 | 1178 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
|
1179 fprintf (plot_stream, |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1180 "set palette positive color model RGB maxcolors %i;\n", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1181 cmap_sz); |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1182 fprintf (plot_stream, |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1183 "set palette file \"-\" binary record=%d using 1:2:3:4;\n", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1184 cmap_sz); |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1185 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
|
1186 fwrite (plot_stream, "\n"); |
7189 | 1187 endif |
8208 | 1188 |
1189 fputs (plot_stream, "unset colorbox;\n"); | |
7189 | 1190 |
6405 | 1191 if (have_data) |
1192 if (nd == 2) | |
1193 plot_cmd = "plot"; | |
1194 else | |
1195 plot_cmd = "splot"; | |
1196 rot_x = 90 - axis_obj.view(2); | |
1197 rot_z = axis_obj.view(1); | |
1198 while (rot_z < 0) | |
1199 rot_z += 360; | |
1200 endwhile | |
6461 | 1201 fputs (plot_stream, "set ticslevel 0;\n"); |
7271 | 1202 if (view_map && rot_x == 0 && rot_z == 0) |
1203 fputs (plot_stream, "set view map;\n"); | |
1204 else | |
1205 fprintf (plot_stream, "set view %.15g, %.15g;\n", rot_x, rot_z); | |
1206 endif | |
6405 | 1207 endif |
8226
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1208 if (is_image_data (1)) |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1209 fprintf (plot_stream, "%s \"-\" %s %s %s \\\n", plot_cmd, |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1210 usingclause{1}, titlespec{1}, withclause{1}); |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1211 else |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1212 fprintf (plot_stream, "%s \"-\" binary format='%%float64' %s %s %s \\\n", plot_cmd, |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1213 usingclause{1}, titlespec{1}, withclause{1}); |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1214 endif |
6405 | 1215 for i = 2:data_idx |
8226
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1216 if (is_image_data (i)) |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1217 fprintf (plot_stream, "%s \"-\" %s %s %s \\\n", plot_cmd, |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1218 usingclause{i}, titlespec{i}, withclause{i}); |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1219 else |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1220 fprintf (plot_stream, ", \"-\" binary format='%%float64' %s %s %s \\\n", |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1221 usingclause{i}, titlespec{i}, withclause{i}); |
50fa927b4e49
Fix for images with new gnuplot/binary transfer code
David Bateman <dbateman@free.fr>
parents:
8222
diff
changeset
|
1222 endif |
6405 | 1223 endfor |
1224 fputs (plot_stream, ";\n"); | |
1225 for i = 1:data_idx | |
6464 | 1226 if (is_image_data(i)) |
1227 fwrite (plot_stream, data{i}, "float32"); | |
1228 else | |
7119 | 1229 __gnuplot_write_data__ (plot_stream, data{i}, nd, parametric(i), |
1230 have_cdata(i)); | |
6405 | 1231 endif |
1232 endfor | |
6431 | 1233 else |
1234 fputs (plot_stream, "plot \"-\";\nInf Inf\ne\n"); | |
6405 | 1235 endif |
1236 | |
8506 | 1237 ## Needed to allow mouse rotation with pcolor. |
7271 | 1238 if (view_map) |
1239 fputs (plot_stream, "unset view;\n"); | |
1240 endif | |
1241 | |
6405 | 1242 fflush (plot_stream); |
1243 | |
1244 else | |
1245 print_usage (); | |
7109 | 1246 endif |
6405 | 1247 |
1248 endfunction | |
1249 | |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1250 function [style, typ, with] = do_linestyle_command (obj, idx, mono, |
7513
05eb3486f650
__stepimp__: don't call subplot for single plot
John W. Eaton <jwe@octave.org>
parents:
7510
diff
changeset
|
1251 plot_stream, errbars = "") |
6405 | 1252 |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1253 fprintf (plot_stream, "set style line %d default;\n", idx); |
6405 | 1254 fprintf (plot_stream, "set style line %d", idx); |
1255 | |
1256 found_style = false; | |
6425 | 1257 typ = NaN; |
6465 | 1258 with = ""; |
6405 | 1259 |
6425 | 1260 if (isfield (obj, "color")) |
6405 | 1261 color = obj.color; |
1262 if (isnumeric (color)) | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1263 if (! mono) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1264 fprintf (plot_stream, " linecolor rgb \"#%02x%02x%02x\"", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1265 round (255*color)); |
6425 | 1266 endif |
6405 | 1267 endif |
1268 found_style = true; | |
1269 endif | |
1270 | |
1271 if (isfield (obj, "linestyle")) | |
1272 switch (obj.linestyle) | |
1273 case "-" | |
6415 | 1274 lt = "1"; |
6405 | 1275 case "--" |
6415 | 1276 lt = "2"; |
6405 | 1277 case ":" |
6415 | 1278 lt = "3"; |
6405 | 1279 case "-." |
6415 | 1280 lt = "6"; |
6405 | 1281 case "none" |
1282 lt = ""; | |
1283 otherwise | |
1284 lt = ""; | |
1285 endswitch | |
6843 | 1286 |
1287 ## FIXME -- linetype is currently broken, since it disables the | |
1288 ## gnuplot default dashed and solid linestyles with the only | |
1289 ## benefit of being able to specify '--' and get a single sized | |
1290 ## dashed line of identical dash pattern for all called this way. | |
1291 ## All dash patterns are a subset of "with lines" and none of the | |
1292 ## lt specifications will correctly propagate into the x11 terminal | |
1293 ## or the print command. Therefore, it is currently disabled in | |
1294 ## order to allow print (..., "-dashed") etc. to work correctly. | |
1295 | |
1296 ## if (! isempty (lt)) | |
1297 ## fprintf (plot_stream, " linetype %s", lt); | |
1298 ## found_style = true; | |
1299 ## endif | |
1300 | |
6405 | 1301 else |
1302 lt = ""; | |
1303 endif | |
1304 | |
1305 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
|
1306 fprintf (plot_stream, " linewidth %f", obj.linewidth); |
6405 | 1307 found_style = true; |
1308 endif | |
1309 | |
1310 if (isfield (obj, "marker")) | |
1311 switch (obj.marker) | |
1312 case "+" | |
1313 pt = "1"; | |
1314 case "o" | |
6413 | 1315 pt = "6"; |
6405 | 1316 case "*" |
1317 pt = "3"; | |
1318 case "." | |
7078 | 1319 pt = "0"; |
6405 | 1320 case "x" |
1321 pt = "2"; | |
1322 case {"square", "s"} | |
1323 pt = "5"; | |
1324 case {"diamond", "d"} | |
1325 pt = "13"; | |
1326 case "^" | |
1327 pt = "9"; | |
1328 case "v" | |
1329 pt = "11"; | |
1330 case ">" | |
1331 pt = "8"; | |
1332 case "<" | |
1333 pt = "10"; | |
1334 case {"pentagram", "p"} | |
1335 pt = "4"; | |
1336 case {"hexagram", "h"} | |
6413 | 1337 pt = "12"; |
6405 | 1338 case "none" |
1339 pt = ""; | |
1340 otherwise | |
1341 pt = ""; | |
1342 endswitch | |
1343 if (! isempty (pt)) | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1344 fprintf (plot_stream, " pointtype %s", pt); |
6405 | 1345 found_style = true; |
1346 endif | |
1347 else | |
1348 pt = ""; | |
1349 endif | |
1350 | |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1351 if (isempty (errbars)) |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1352 style = "lines"; |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1353 if (isempty (lt)) |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1354 if (! isempty (pt)) |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1355 style = "points"; |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1356 endif |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1357 elseif (! isempty (pt)) |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1358 style = "linespoints"; |
6405 | 1359 endif |
1360 | |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1361 if (isfield (obj, "markersize")) |
8510
738cb6271933
__go_draw_axes__.m: scale markersize by 1/3 instead of 1/6
John W. Eaton <jwe@octave.org>
parents:
8506
diff
changeset
|
1362 fprintf (plot_stream, " pointsize %f", obj.markersize / 3); |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1363 found_style = true; |
6465 | 1364 endif |
7510
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1365 else |
f3e6ada67d9e
improve handling line style for errorbar plots
John W. Eaton <jwe@octave.org>
parents:
7472
diff
changeset
|
1366 style = errbars; |
6465 | 1367 found_style = true; |
1368 endif | |
1369 | |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1370 if (! found_style) |
6405 | 1371 fputs (plot_stream, " default"); |
1372 endif | |
1373 | |
1374 fputs (plot_stream, ";\n"); | |
1375 | |
1376 endfunction | |
6510 | 1377 |
7316 | 1378 function nd = __calc_dimensions__ (obj) |
1379 kids = obj.children; | |
1380 nd = 2; | |
1381 for i = 1:length (kids) | |
1382 obj = get (kids(i)); | |
1383 switch (obj.type) | |
1384 case {"image", "text"} | |
1385 ## ignore as they | |
1386 case {"line", "patch"} | |
1387 if (! isempty (obj.zdata)) | |
1388 nd = 3; | |
1389 endif | |
1390 case "surface" | |
1391 nd = 3; | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1392 case "hggroup" |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1393 obj_nd = __calc_dimensions__ (obj); |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1394 if (obj_nd == 3) |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1395 nd = 3; |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7726
diff
changeset
|
1396 endif |
7316 | 1397 endswitch |
1398 endfor | |
1399 endfunction | |
1400 | |
7119 | 1401 function __gnuplot_write_data__ (plot_stream, data, nd, parametric, cdata) |
6510 | 1402 |
1403 ## DATA is already transposed. | |
1404 | |
1405 ## FIXME -- this may need to be converted to C++ for speed. | |
1406 | |
6605 | 1407 ## Convert NA elements to normal NaN values because fprintf writes |
1408 ## "NA" and that confuses gnuplot. | |
1409 idx = find (isna (data)); | |
1410 if (any (idx)) | |
1411 data(idx) = NaN; | |
1412 endif | |
1413 | |
6510 | 1414 if (nd == 2) |
8217
f74cb5e3a6c1
send binary data to gnuplot
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8216
diff
changeset
|
1415 fwrite (plot_stream, data, "float64"); |
7109 | 1416 elseif (nd == 3) |
6510 | 1417 if (parametric) |
8217
f74cb5e3a6c1
send binary data to gnuplot
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8216
diff
changeset
|
1418 fwrite (plot_stream, data, "float64"); |
6510 | 1419 else |
7170 | 1420 nr = rows (data); |
7119 | 1421 if (cdata) |
7170 | 1422 for j = 1:4:nr |
8217
f74cb5e3a6c1
send binary data to gnuplot
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8216
diff
changeset
|
1423 fwrite (plot_stream, data(j:j+3,:), "float64"); |
7119 | 1424 endfor |
1425 else | |
7170 | 1426 for j = 1:3:nr |
8217
f74cb5e3a6c1
send binary data to gnuplot
Daniel J. Sebald <daniel.sebald@ieee.org>
parents:
8216
diff
changeset
|
1427 fwrite (plot_stream, data(j:j+2,:), "float64"); |
7119 | 1428 endfor |
1429 endif | |
7109 | 1430 endif |
6510 | 1431 endif |
1432 | |
1433 endfunction | |
6745 | 1434 |
7269 | 1435 function do_tics (obj, plot_stream, ymirror, mono) |
8222
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1436 |
8518
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1437 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
|
1438 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
|
1439 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
|
1440 |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1441 [fontname, fontsize] = get_fontname_and_size (obj); |
8222
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1442 |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1443 ## 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
|
1444 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
|
1445 |
6809 | 1446 if (strcmpi (obj.xaxislocation, "top")) |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1447 do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1448 obj.xticklabel, obj.xcolor, "x2", plot_stream, true, mono, |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1449 "border", obj.tickdir, ticklength, fontname, fontsize, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1450 obj.interpreter); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1451 do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1452 obj.xcolor, "x", plot_stream, true, mono, "border", |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1453 "", "", fontname, fontsize, obj.interpreter); |
7321 | 1454 elseif (strcmpi (obj.xaxislocation, "zero")) |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1455 do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1456 obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1457 "axis", obj.tickdir, ticklength, fontname, fontsize, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1458 obj.interpreter); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1459 do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1460 obj.xcolor, "x2", plot_stream, true, mono, "axis", |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1461 "", "", fontname, fontsize, obj.interpreter); |
6809 | 1462 else |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1463 do_tics_1 (obj.xtickmode, obj.xtick, obj.xminortick, obj.xticklabelmode, |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1464 obj.xticklabel, obj.xcolor, "x", plot_stream, true, mono, |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1465 "border", obj.tickdir, ticklength, fontname, fontsize, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1466 obj.interpreter); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1467 do_tics_1 ("manual", [], "off", obj.xticklabelmode, obj.xticklabel, |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1468 obj.xcolor, "x2", plot_stream, true, mono, "border", |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1469 "", "", fontname, fontsize, obj.interpreter); |
6809 | 1470 endif |
1471 if (strcmpi (obj.yaxislocation, "right")) | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1472 do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1473 obj.yticklabel, obj.ycolor, "y2", plot_stream, ymirror, mono, |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1474 "border", obj.tickdir, ticklength, fontname, fontsize, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1475 obj.interpreter); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1476 do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1477 obj.ycolor, "y", plot_stream, ymirror, mono, "border", |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1478 "", "", fontname, fontsize, obj.interpreter); |
8943
4a312440b262
__go_draw_axes__.m (do_tics): fix typo
Ben Abbott <bpabbott@mac.com>
parents:
8920
diff
changeset
|
1479 elseif (strcmpi (obj.yaxislocation, "zero")) |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1480 do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1481 obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1482 "axis", obj.tickdir, ticklength, fontname, fontsize, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1483 obj.interpreter); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1484 do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1485 obj.ycolor, "y2", plot_stream, ymirror, mono, "axis", |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1486 "", "", fontname, fontsize, obj.interpreter); |
6809 | 1487 else |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1488 do_tics_1 (obj.ytickmode, obj.ytick, obj.yminortick, obj.yticklabelmode, |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1489 obj.yticklabel, obj.ycolor, "y", plot_stream, ymirror, mono, |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1490 "border", obj.tickdir, ticklength, fontname, fontsize, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1491 obj.interpreter); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1492 do_tics_1 ("manual", [], "off", obj.yticklabelmode, obj.yticklabel, |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1493 obj.ycolor, "y2", plot_stream, ymirror, mono, "border", |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1494 "", "", fontname, fontsize, obj.interpreter); |
6809 | 1495 endif |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1496 do_tics_1 (obj.ztickmode, obj.ztick, obj.zminortick, obj.zticklabelmode, |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1497 obj.zticklabel, obj.zcolor, "z", plot_stream, true, mono, |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1498 "border", obj.tickdir, ticklength, fontname, fontsize, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1499 obj.interpreter); |
6745 | 1500 endfunction |
1501 | |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1502 function do_tics_1 (ticmode, tics, mtics, labelmode, labels, color, ax, |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1503 plot_stream, mirror, mono, axispos, tickdir, ticklength, |
8222
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1504 fontname, fontsize, interpreter) |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1505 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
|
1506 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
|
1507 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
|
1508 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
|
1509 endfor |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1510 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
|
1511 if (! warned_latex) |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1512 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
|
1513 warned_latex = true; |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1514 endif |
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1515 endif |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1516 if (strcmp (fontname, "*")) |
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1517 fontspec = ""; |
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1518 else |
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1519 fontspec = sprintf ("font \"%s,%d\"", fontname, fontsize); |
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1520 endif |
7269 | 1521 colorspec = get_text_colorspec (color, mono); |
8112
31e86163b752
Add the datetick function
David Bateman <dbateman@free.fr>
parents:
8102
diff
changeset
|
1522 if (strcmpi (ticmode, "manual") || strcmpi (labelmode, "manual")) |
6745 | 1523 if (isempty (tics)) |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1524 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
|
1525 elseif (strcmpi (labelmode, "manual")) |
6751 | 1526 if (ischar (labels)) |
1527 labels = cellstr (labels); | |
1528 endif | |
8354
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1529 if (isnumeric (labels)) |
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1530 labels = num2str (real (labels(:))); |
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1531 endif |
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1532 if (ischar (labels)) |
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1533 labels = permute (cellstr (labels), [2, 1]); |
534fd216278c
__go_draw_axes__.m: xticklabel should accept a numeric vector.
Ben Abbott <bpabbott@mac.com>
parents:
8344
diff
changeset
|
1534 endif |
6745 | 1535 if (iscellstr (labels)) |
6751 | 1536 k = 1; |
1537 ntics = numel (tics); | |
1538 nlabels = numel (labels); | |
6745 | 1539 fprintf (plot_stream, "set format %s \"%%s\";\n", ax); |
7206 | 1540 if (mirror) |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1541 fprintf (plot_stream, "set %stics %s %s %s mirror (", ax, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1542 tickdir, ticklength, axispos); |
7206 | 1543 else |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1544 fprintf (plot_stream, "set %stics %s %s %s nomirror (", ax, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1545 tickdir, ticklength, axispos); |
7206 | 1546 endif |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1547 |
7228 | 1548 labels = regexprep(labels, "%", "%%"); |
6745 | 1549 for i = 1:ntics |
8112
31e86163b752
Add the datetick function
David Bateman <dbateman@free.fr>
parents:
8102
diff
changeset
|
1550 fprintf (plot_stream, " \"%s\" %.15g", labels{k++}, tics(i)); |
6745 | 1551 if (i < ntics) |
1552 fputs (plot_stream, ", "); | |
1553 endif | |
1554 if (k > nlabels) | |
1555 k = 1; | |
1556 endif | |
1557 endfor | |
8220
4e05ba66ead2
x/y/z-ticklabels respect axis font properties.
Ben Abbott <bpabbott@mac.com>
parents:
8218
diff
changeset
|
1558 fprintf (plot_stream, ") %s %s;\n", colorspec, fontspec); |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1559 if (strcmp (mtics, "on")) |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1560 fprintf (plot_stream, "set m%stics 5;\n", ax); |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1561 else |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1562 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
|
1563 endif |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1564 else |
6745 | 1565 error ("unsupported type of ticklabel"); |
1566 endif | |
1567 else | |
6920 | 1568 fprintf (plot_stream, "set format %s \"%%g\";\n", ax); |
7206 | 1569 if (mirror) |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1570 fprintf (plot_stream, "set %stics %s %s %s mirror (", ax, tickdir, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1571 ticklength, axispos); |
7206 | 1572 else |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1573 fprintf (plot_stream, "set %stics %s %s %s nomirror (", ax, tickdir, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1574 ticklength, axispos); |
7206 | 1575 endif |
8112
31e86163b752
Add the datetick function
David Bateman <dbateman@free.fr>
parents:
8102
diff
changeset
|
1576 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
|
1577 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
|
1578 if (strcmp (mtics, "on")) |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1579 fprintf (plot_stream, "set m%stics 5;\n", ax); |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1580 else |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1581 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
|
1582 endif |
6745 | 1583 endif |
1584 else | |
6920 | 1585 fprintf (plot_stream, "set format %s \"%%g\";\n", ax); |
7206 | 1586 if (mirror) |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1587 fprintf (plot_stream, "set %stics %s %s %s mirror %s %s;\n", ax, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1588 axispos, tickdir, ticklength, colorspec, fontspec); |
7206 | 1589 else |
8740
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1590 fprintf (plot_stream, "set %stics %s %s %s nomirror %s %s;\n", ax, |
cb0ea772a4af
Initialize axes ticklength property.
Ben Abbott <bpabbott@mac.com>
parents:
8665
diff
changeset
|
1591 tickdir, ticklength, axispos, colorspec, fontspec); |
7206 | 1592 endif |
8322
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1593 if (strcmp (mtics, "on")) |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1594 fprintf (plot_stream, "set m%stics 5;\n", ax); |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1595 else |
f32a91d99156
Respect the minortick property of the axis objects
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
1596 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
|
1597 endif |
7194 | 1598 endif |
1599 endfunction | |
1600 | |
8518
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1601 function ticklabel = ticklabel_to_cell (ticklabel) |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1602 if (! isempty (ticklabel) && ! iscell (ticklabel)) |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1603 if (isnumeric (ticklabel)) |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1604 ## Use upto 5 significant digits |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1605 ticklabel = num2str (ticklabel(:), 5); |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1606 endif |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1607 ticklabel = cellstr (ticklabel); |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1608 endif |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1609 endfunction |
c2c018d7c501
__go_draw_axes__.m: __go_draw_axes__.m: Support non-cell ticklabels.
Ben Abbott <bpabbott@mac.com>
parents:
8510
diff
changeset
|
1610 |
7269 | 1611 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
|
1612 if (mono) |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1613 colorspec = ""; |
7194 | 1614 else |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1615 colorspec = sprintf ("textcolor rgb \"#%02x%02x%02x\"", |
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1616 round (255*color)); |
6745 | 1617 endif |
1618 endfunction | |
7163 | 1619 |
7189 | 1620 function [f, s, fnt, it, bld] = get_fontname_and_size (t) |
7163 | 1621 if (isempty (t.fontname)) |
7372 | 1622 fnt = "Helvetica"; |
7163 | 1623 else |
7372 | 1624 fnt = t.fontname; |
7168 | 1625 endif |
7189 | 1626 f = fnt; |
1627 it = false; | |
1628 bld = false; | |
7372 | 1629 if (! isempty (t.fontweight) && strcmpi (t.fontweight, "bold")) |
7168 | 1630 if (! isempty(t.fontangle) |
7372 | 1631 && (strcmpi (t.fontangle, "italic") |
1632 || 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
|
1633 f = cstrcat (f, "-bolditalic"); |
7189 | 1634 it = true; |
1635 bld = true; | |
7168 | 1636 else |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1637 f = cstrcat (f, "-bold"); |
7189 | 1638 bld = true; |
7168 | 1639 endif |
1640 elseif (! isempty(t.fontangle) | |
7372 | 1641 && (strcmpi (t.fontangle, "italic") |
1642 || 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
|
1643 f = cstrcat (f, "-italic"); |
7189 | 1644 it = true; |
7163 | 1645 endif |
1646 if (isempty (t.fontsize)) | |
1647 s = 10; | |
1648 else | |
1649 s = t.fontsize; | |
1650 endif | |
1651 endfunction | |
7189 | 1652 |
8164
0d37c99fc06f
__go_draw_axes__.m: eliminate have_newer_gnuplot variable
John W. Eaton <jwe@octave.org>
parents:
8112
diff
changeset
|
1653 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
|
1654 |
7189 | 1655 persistent warned_latex = false; |
1656 | |
1657 if (strcmp (fld, "string")) | |
1658 [f, s, fnt, it, bld] = get_fontname_and_size (obj); | |
1659 else | |
7372 | 1660 f = "Helvetica"; |
7189 | 1661 s = 10; |
1662 fnt = f; | |
1663 it = false; | |
1664 bld = false; | |
1665 endif | |
1666 | |
1667 str = getfield (obj, fld); | |
1668 if (enhanced) | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
1669 if (strcmpi (obj.interpreter, "tex")) |
7189 | 1670 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
|
1671 elseif (strcmpi (obj.interpreter, "latex")) |
7189 | 1672 if (! warned_latex) |
8222
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8220
diff
changeset
|
1673 warning ("latex markup not supported for text objects"); |
7189 | 1674 warned_latex = true; |
1675 endif | |
1676 endif | |
1677 endif | |
1678 endfunction | |
1679 | |
1680 function str = __tex2enhanced__ (str, fnt, it, bld) | |
1681 persistent sym = __setup_sym_table__ (); | |
1682 persistent flds = fieldnames (sym); | |
1683 | |
1684 [s, e, m] = regexp(str,'\\([a-zA-Z]+|0)','start','end','matches'); | |
1685 | |
1686 for i = length (s) : -1 : 1 | |
1687 ## special case for "\0" and replace with "{/Symbol \306}' | |
1688 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
|
1689 str = cstrcat (str(1:s(i) - 1), '{/Symbol \306}', str(s(i) + 2:end)); |
7189 | 1690 else |
1691 f = m{i}(2:end); | |
1692 if (isfield (sym, f)) | |
1693 g = getfield(sym, f); | |
1694 ## FIXME The symbol font doesn't seem to support bold or italic | |
1695 ##if (bld) | |
1696 ## if (it) | |
1697 ## g = regexprep (g, '/Symbol', '/Symbol-bolditalic'); | |
1698 ## else | |
1699 ## g = regexprep (g, '/Symbol', '/Symbol-bold'); | |
1700 ## endif | |
1701 ##elseif (it) | |
1702 ## g = regexprep (g, '/Symbol', '/Symbol-italic'); | |
1703 ##endif | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1704 str = cstrcat (str(1:s(i) - 1), g, str(e(i) + 1:end)); |
7189 | 1705 elseif (strncmp (f, "rm", 2)) |
1706 bld = false; | |
1707 it = false; | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1708 str = cstrcat (str(1:s(i) - 1), '/', fnt, ' ', str(s(i) + 3:end)); |
7189 | 1709 elseif (strncmp (f, "it", 2) || strncmp (f, "sl", 2)) |
1710 it = true; | |
1711 if (bld) | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1712 str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bolditalic ', |
7189 | 1713 str(s(i) + 3:end)); |
1714 else | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1715 str = cstrcat (str(1:s(i) - 1), '/', fnt, '-italic ', |
7189 | 1716 str(s(i) + 3:end)); |
1717 endif | |
1718 elseif (strncmp (f, "bf", 2)) | |
1719 bld = true; | |
1720 if (it) | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1721 str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bolditalic ', |
7189 | 1722 str(2(i) + 3:end)); |
1723 else | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1724 str = cstrcat (str(1:s(i) - 1), '/', fnt, '-bold ', |
7189 | 1725 str(s(i) + 3:end)); |
1726 endif | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
1727 elseif (strcmpi (f, "color")) |
7189 | 1728 ## FIXME Ignore \color but remove trailing {} block as well |
1729 d = strfind(str(e(i) + 1:end),'}'); | |
1730 if (isempty (d)) | |
1731 warning ('syntax error in \color argument'); | |
1732 else | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1733 str = cstrcat (str(1:s(i) - 1), str(e(i) + d + 1:end)); |
7189 | 1734 endif |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
1735 elseif(strcmpi (f, "fontname")) |
7189 | 1736 b1 = strfind(str(e(i) + 1:end),'{'); |
1737 b2 = strfind(str(e(i) + 1:end),'}'); | |
1738 if (isempty(b1) || isempty(b2)) | |
1739 warning ('syntax error in \fontname argument'); | |
1740 else | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1741 str = cstrcat (str(1:s(i) - 1), '/', |
7189 | 1742 str(e(i)+b1(1) + 1:e(i)+b2(1)-1), '{}', |
1743 str(e(i) + b2(1) + 1:end)); | |
1744 endif | |
8190
73d6b71788c0
use case-insensitive comparison for graphics properties; misc style fixes
John W. Eaton <jwe@octave.org>
parents:
8171
diff
changeset
|
1745 elseif(strcmpi (f, "fontsize")) |
7189 | 1746 b1 = strfind(str(e(i) + 1:end),'{'); |
1747 b2 = strfind(str(e(i) + 1:end),'}'); | |
1748 if (isempty(b1) || isempty(b2)) | |
1749 warning ('syntax error in \fontname argument'); | |
1750 else | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1751 str = cstrcat (str(1:s(i) - 1), '/=', |
7189 | 1752 str(e(i)+b1(1) + 1:e(i)+b2(1)-1), '{}', |
1753 str(e(i) + b2(1) + 1:end)); | |
1754 endif | |
1755 else | |
1756 ## Last desperate attempt to treat the symbol. Look for things | |
1757 ## like \pix, that should be translated to the symbol Pi and x | |
1758 for j = 1 : length (flds) | |
1759 if (strncmp (flds{j}, f, length (flds{j}))) | |
1760 g = getfield(sym, flds{j}); | |
1761 ## FIXME The symbol font doesn't seem to support bold or italic | |
1762 ##if (bld) | |
1763 ## if (it) | |
1764 ## g = regexprep (g, '/Symbol', '/Symbol-bolditalic'); | |
1765 ## else | |
1766 ## g = regexprep (g, '/Symbol', '/Symbol-bold'); | |
1767 ## endif | |
1768 ##elseif (it) | |
1769 ## g = regexprep (g, '/Symbol', '/Symbol-italic'); | |
1770 ##endif | |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1771 str = cstrcat (str(1:s(i) - 1), g, |
7189 | 1772 str(s(i) + length (flds{j}) + 1:end)); |
1773 break; | |
1774 endif | |
1775 endfor | |
1776 endif | |
1777 endif | |
1778 endfor | |
1779 | |
8506 | 1780 ## Prepend @ to things things like _0^x or _{-100}^{100} for |
1781 ## alignment But need to put the shorter of the two arguments first. | |
1782 ## Carful of nested {} and unprinted characters when defining | |
1783 ## shortest.. Don't have to worry about things like ^\theta as they | |
1784 ## are already converted to ^{/Symbol q}. | |
7189 | 1785 |
8506 | 1786 ## FIXME -- This is a mess... Is it worth it just for a "@" character? |
7189 | 1787 |
1788 [s, m] = regexp(str,'[_\^]','start','matches'); | |
1789 i = 1; | |
1790 p = 0; | |
1791 while (i < length (s)) | |
1792 if (i < length(s)) | |
1793 if (str(s(i) + p + 1) == "{") | |
1794 s1 = strfind(str(s(i) + p + 2:end),'{'); | |
1795 si = 1; | |
1796 l1 = strfind(str(s(i) + p + 1:end),'}'); | |
1797 li = 1; | |
1798 while (li <= length (l1) && si <= length (s1)) | |
1799 if (l1(li) < s1(si)) | |
1800 if (li == si) | |
1801 break; | |
1802 endif | |
1803 li++; | |
1804 else | |
1805 si++; | |
1806 endif | |
1807 endwhile | |
1808 l1 = l1 (min (length(l1), si)); | |
1809 if (s(i) + l1 + 1 == s(i+1)) | |
1810 if (str(s(i + 1) + p + 1) == "{") | |
1811 s2 = strfind(str(s(i + 1) + p + 2:end),'{'); | |
1812 si = 1; | |
1813 l2 = strfind(str(s(i + 1) + p + 1:end),'}'); | |
1814 li = 1; | |
1815 while (li <= length (l2) && si <= length (s2)) | |
1816 if (l2(li) < s2(si)) | |
1817 if (li == si) | |
1818 break; | |
1819 endif | |
1820 li++; | |
1821 else | |
1822 si++; | |
1823 endif | |
1824 endwhile | |
1825 l2 = l2 (min (length(l2), si)); | |
1826 if (length_string (str(s(i)+p+2:s(i)+p+l1-1)) <= | |
1827 length_string(str(s(i+1)+p+2:s(i+1)+p+l2-1))) | |
8506 | 1828 ## Shortest already first! |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1829 str = cstrcat (str(1:s(i)+p-1), "@", str(s(i)+p:end)); |
7189 | 1830 else |
8506 | 1831 ## Have to swap sub/super-script to get shortest first. |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1832 str = cstrcat (str(1:s(i)+p-1), "@", str(s(i+1)+p:s(i+1)+p+l2), |
7189 | 1833 str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+l2+1:end)); |
1834 endif | |
1835 else | |
8506 | 1836 ## Have to swap sub/super-script to get shortest first. |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1837 str = cstrcat (str(1:s(i)+p-1), "@", str(s(i+1)+p:s(i+1)+p+1), |
7189 | 1838 str(s(i)+p:s(i)+p+l1), str(s(i+1)+p+2:end)); |
1839 endif | |
1840 i += 2; | |
1841 p ++; | |
1842 else | |
1843 i++; | |
1844 endif | |
1845 else | |
1846 if (s(i+1) == s(i) + 2) | |
8506 | 1847 ## Shortest already first! |
7540
3422f39573b1
strcat.m: Matlab compatibility, with cstrcat.m replacing conventional strcat.m.
Ben Abbott <bpabbott@mac.com>
parents:
7513
diff
changeset
|
1848 str = cstrcat (str(1:s(i)+p-1), "@", str(s(i)+p:end)); |
7189 | 1849 p ++; |
1850 i += 2; | |
1851 else | |
1852 i ++; | |
1853 endif | |
1854 endif | |
1855 else | |
1856 i ++; | |
1857 endif | |
1858 endwhile | |
1859 | |
1860 endfunction | |
1861 | |
1862 function l = length_string (s) | |
1863 l = length (s) - length (strfind(s,'{')) - length (strfind(s,'}')); | |
1864 m = regexp (s, '/([\w\-]+|[\w\-]+=\d+)', 'matches'); | |
1865 if (!isempty (m)) | |
1866 l = l - sum (cellfun (@length, m)); | |
1867 endif | |
1868 endfunction | |
1869 | |
1870 function sym = __setup_sym_table__ () | |
1871 ## Setup the translation table for TeX to gnuplot enhanced mode. | |
1872 sym.forall = '{/Symbol \042}'; | |
1873 sym.exists = '{/Symbol \044}'; | |
1874 sym.ni = '{/Symbol \047}'; | |
1875 sym.cong = '{/Symbol \100}'; | |
1876 sym.Delta = '{/Symbol D}'; | |
1877 sym.Phi = '{/Symbol F}'; | |
7608
49810341db91
Correct typos in __go_draw_axes__.m and update Manual
godfrey@qss.Stanford.EDU
parents:
7603
diff
changeset
|
1878 sym.Gamma = '{/Symbol G}'; |
7190 | 1879 sym.vartheta = '{/Symbol J}'; |
7189 | 1880 sym.Lambda = '{/Symbol L}'; |
1881 sym.Pi = '{/Symbol P}'; | |
1882 sym.Theta = '{/Symbol Q}'; | |
1883 sym.Sigma = '{/Symbol S}'; | |
1884 sym.varsigma = '{/Symbol V}'; | |
7420 | 1885 sym.Omega = '{/Symbol W}'; |
7189 | 1886 sym.Xi = '{/Symbol X}'; |
1887 sym.Psi = '{/Symbol Y}'; | |
1888 sym.perp = '{/Symbol \136}'; | |
1889 sym.alpha = '{/Symbol a}'; | |
1890 sym.beta = '{/Symbol b}'; | |
1891 sym.chi = '{/Symbol c}'; | |
1892 sym.delta = '{/Symbol d}'; | |
1893 sym.epsilon = '{/Symbol e}'; | |
1894 sym.phi = '{/Symbol f}'; | |
7608
49810341db91
Correct typos in __go_draw_axes__.m and update Manual
godfrey@qss.Stanford.EDU
parents:
7603
diff
changeset
|
1895 sym.gamma = '{/Symbol g}'; |
7189 | 1896 sym.eta = '{/Symbol h}'; |
1897 sym.iota = '{/Symbol i}'; | |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1898 sym.varphi = '{/Symbol j}'; |
7189 | 1899 sym.kappa = '{/Symbol k}'; |
1900 sym.lambda = '{/Symbol l}'; | |
1901 sym.mu = '{/Symbol m}'; | |
1902 sym.nu = '{/Symbol n}'; | |
1903 sym.o = '{/Symbol o}'; | |
1904 sym.pi = '{/Symbol p}'; | |
1905 sym.theta = '{/Symbol q}'; | |
1906 sym.rho = '{/Symbol r}'; | |
1907 sym.sigma = '{/Symbol s}'; | |
1908 sym.tau = '{/Symbol t}'; | |
1909 sym.upsilon = '{/Symbol u}'; | |
1910 sym.varpi = '{/Symbol v}'; | |
1911 sym.omega = '{/Symbol w}'; | |
1912 sym.xi = '{/Symbol x}'; | |
1913 sym.psi = '{/Symbol y}'; | |
1914 sym.zeta = '{/Symbol z}'; | |
1915 sym.sim = '{/Symbol \176}'; | |
1916 sym.Upsilon = '{/Symbol \241}'; | |
1917 sym.prime = '{/Symbol \242}'; | |
1918 sym.leq = '{/Symbol \243}'; | |
1919 sym.infty = '{/Symbol \245}'; | |
1920 sym.clubsuit = '{/Symbol \247}'; | |
1921 sym.diamondsuit = '{/Symbol \250}'; | |
1922 sym.heartsuit = '{/Symbol \251}'; | |
1923 sym.spadesuit = '{/Symbol \252}'; | |
1924 sym.leftrightarrow = '{/Symbol \253}'; | |
1925 sym.leftarrow = '{/Symbol \254}'; | |
1926 sym.uparrow = '{/Symbol \255}'; | |
1927 sym.rightarrow = '{/Symbol \256}'; | |
1928 sym.downarrow = '{/Symbol \257}'; | |
1929 sym.circ = '{/Symbol \260}'; | |
1930 sym.pm = '{/Symbol \261}'; | |
1931 sym.geq = '{/Symbol \263}'; | |
1932 sym.times = '{/Symbol \264}'; | |
1933 sym.propto = '{/Symbol \265}'; | |
1934 sym.partial = '{/Symbol \266}'; | |
1935 sym.bullet = '{/Symbol \267}'; | |
1936 sym.div = '{/Symbol \270}'; | |
1937 sym.neq = '{/Symbol \271}'; | |
1938 sym.equiv = '{/Symbol \272}'; | |
1939 sym.approx = '{/Symbol \273}'; | |
1940 sym.ldots = '{/Symbol \274}'; | |
1941 sym.mid = '{/Symbol \275}'; | |
1942 sym.aleph = '{/Symbol \300}'; | |
1943 sym.Im = '{/Symbol \301}'; | |
1944 sym.Re = '{/Symbol \302}'; | |
1945 sym.wp = '{/Symbol \303}'; | |
1946 sym.otimes = '{/Symbol \304}'; | |
1947 sym.oplus = '{/Symbol \305}'; | |
1948 sym.oslash = '{/Symbol \306}'; | |
1949 sym.cap = '{/Symbol \307}'; | |
1950 sym.cup = '{/Symbol \310}'; | |
1951 sym.supset = '{/Symbol \311}'; | |
1952 sym.supseteq = '{/Symbol \312}'; | |
1953 sym.subset = '{/Symbol \314}'; | |
1954 sym.subseteq = '{/Symbol \315}'; | |
1955 sym.in = '{/Symbol \316}'; | |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1956 sym.notin = '{/Symbol \317}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1957 sym.angle = '{/Symbol \320}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1958 sym.bigtriangledown = '{/Symbol \321}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1959 sym.langle = '{/Symbol \341}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1960 sym.rangle = '{/Symbol \361}'; |
7189 | 1961 sym.nabla = '{/Symbol \321}'; |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1962 sym.prod = '{/Symbol \325}'; |
7189 | 1963 sym.surd = '{/Symbol \326}'; |
1964 sym.cdot = '{/Symbol \327}'; | |
1965 sym.neg = '{/Symbol \330}'; | |
1966 sym.wedge = '{/Symbol \331}'; | |
1967 sym.vee = '{/Symbol \332}'; | |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1968 sym.Leftrightarrow = '{/Symbol \333}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1969 sym.Leftarrow = '{/Symbol \334}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1970 sym.Uparrow = '{/Symbol \335}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1971 sym.Rightarrow = '{/Symbol \336}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1972 sym.Downarrow = '{/Symbol \337}'; |
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1973 sym.diamond = '{/Symbol \340}'; |
7189 | 1974 sym.copyright = '{/Symbol \343}'; |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1975 sym.lfloor = '{/Symbol \353}'; |
7189 | 1976 sym.lceil = '{/Symbol \351}'; |
7593
fdb6ff523237
__go_draw_axes__: use correct symbol codes
Michael D. Godfrey
parents:
7592
diff
changeset
|
1977 sym.rfloor = '{/Symbol \373}'; |
7189 | 1978 sym.rceil = '{/Symbol \371}'; |
1979 sym.int = '{/Symbol \362}'; | |
1980 endfunction | |
1981 | |
7390 | 1982 function retval = __do_enhanced_option__ (enhanced, obj) |
1983 retval = ""; | |
1984 if (enhanced) | |
1985 if (strcmpi (obj.interpreter, "none")) | |
1986 retval = "noenhanced"; | |
1987 else | |
1988 retval = "enhanced"; | |
1989 endif | |
1990 endif | |
1991 endfunction | |
7542
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
1992 |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
1993 function typ = get_old_gnuplot_color (color) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
1994 if (isequal (color, [0, 0, 0])) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
1995 typ = -1; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
1996 elseif (isequal (color, [1, 0, 0])) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
1997 typ = 1; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
1998 elseif (isequal (color, [0, 1, 0])) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
1999 typ = 2; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2000 elseif (isequal (color, [0, 0, 1])) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2001 typ = 3; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2002 elseif (isequal (color, [1, 0, 1])) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2003 typ = 4; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2004 elseif (isequal (color, [0, 1, 1])) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2005 typ = 5; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2006 elseif (isequal (color, [1, 1, 1])) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2007 typ = -1; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2008 elseif (isequal (color, [1, 1, 0])) |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2009 typ = 7; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2010 else |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2011 typ = -1; |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2012 endif |
b1ff001022af
__go_draw_axes__: eliminate repeated code with get_old_gnuplot_color subfunction
John W. Eaton <jwe@octave.org>
parents:
7541
diff
changeset
|
2013 endfunction |
8889
665b264b6a50
Compatible support of figure paper properties and resolution for the gnuplot backend.
Ben Abbott <bpabbott@mac.com>
parents:
8812
diff
changeset
|
2014 |