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