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