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