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