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