annotate scripts/plot/__go_draw_axes__.m @ 10561:5f46cc552ce5

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