annotate scripts/plot/__go_draw_axes__.m @ 10089:dd70982c81a3

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