comparison scripts/plot/__go_draw_axes__.m @ 11615:4036b9a74886 release-3-0-x

[3-0-0-branch @ 2008-01-16 19:27:14 by jwe]
author jwe
date Wed, 16 Jan 2008 19:27:15 +0000
parents 359f464342b3
children fe5250e05ceb
comparison
equal deleted inserted replaced
11614:26b667edc07a 11615:4036b9a74886
77 if (strcmp (f, "*")) 77 if (strcmp (f, "*"))
78 fontspec = ""; 78 fontspec = "";
79 else 79 else
80 fontspec = sprintf ("font \"%s,%d\"", f, s); 80 fontspec = sprintf ("font \"%s,%d\"", f, s);
81 endif 81 endif
82 fprintf (plot_stream, "set title \"%s\" %s;\n", 82 fprintf (plot_stream, "set title \"%s\" %s %s;\n",
83 undo_string_escapes (tt), fontspec); 83 undo_string_escapes (tt), fontspec,
84 __do_enhanced_option__ (enhanced, t));
84 endif 85 endif
85 endif 86 endif
86 87
87 if (! isempty (axis_obj.xlabel)) 88 if (! isempty (axis_obj.xlabel))
88 t = get (axis_obj.xlabel); 89 t = get (axis_obj.xlabel);
98 fontspec = ""; 99 fontspec = "";
99 else 100 else
100 fontspec = sprintf ("font \"%s,%d\"", f, s); 101 fontspec = sprintf ("font \"%s,%d\"", f, s);
101 endif 102 endif
102 if (strcmpi (axis_obj.xaxislocation, "top")) 103 if (strcmpi (axis_obj.xaxislocation, "top"))
103 fprintf (plot_stream, "set x2label \"%s\" %s %s", 104 fprintf (plot_stream, "set x2label \"%s\" %s %s %s",
104 undo_string_escapes (tt), colorspec, fontspec); 105 undo_string_escapes (tt), colorspec, fontspec,
106 __do_enhanced_option__ (enhanced, t));
105 else 107 else
106 fprintf (plot_stream, "set xlabel \"%s\" %s %s", 108 fprintf (plot_stream, "set xlabel \"%s\" %s %s %s",
107 undo_string_escapes (tt), colorspec, fontspec); 109 undo_string_escapes (tt), colorspec, fontspec,
110 __do_enhanced_option__ (enhanced, t));
108 endif 111 endif
109 if (have_newer_gnuplot) 112 if (have_newer_gnuplot)
110 ## Rotation of xlabel not yet support by gnuplot as of 4.2, but 113 ## Rotation of xlabel not yet support by gnuplot as of 4.2, but
111 ## there is no message about it. 114 ## there is no message about it.
112 fprintf (plot_stream, " rotate by %f", angle); 115 fprintf (plot_stream, " rotate by %f", angle);
134 fontspec = ""; 137 fontspec = "";
135 else 138 else
136 fontspec = sprintf ("font \"%s,%d\"", f, s); 139 fontspec = sprintf ("font \"%s,%d\"", f, s);
137 endif 140 endif
138 if (strcmpi (axis_obj.yaxislocation, "right")) 141 if (strcmpi (axis_obj.yaxislocation, "right"))
139 fprintf (plot_stream, "set y2label \"%s\" %s %s", 142 fprintf (plot_stream, "set y2label \"%s\" %s %s %s",
140 undo_string_escapes (tt), colorspec, fontspec); 143 undo_string_escapes (tt), colorspec, fontspec,
144 __do_enhanced_option__ (enhanced, t));
141 else 145 else
142 fprintf (plot_stream, "set ylabel \"%s\" %s %s", 146 fprintf (plot_stream, "set ylabel \"%s\" %s %s %s",
143 undo_string_escapes (tt), colorspec, fontspec); 147 undo_string_escapes (tt), colorspec, fontspec,
148 __do_enhanced_option__ (enhanced, t));
144 endif 149 endif
145 if (have_newer_gnuplot) 150 if (have_newer_gnuplot)
146 fprintf (plot_stream, " rotate by %f;\n", angle); 151 fprintf (plot_stream, " rotate by %f;\n", angle);
147 endif 152 endif
148 fputs (plot_stream, ";\n"); 153 fputs (plot_stream, ";\n");
166 if (strcmp (f, "*")) 171 if (strcmp (f, "*"))
167 fontspec = ""; 172 fontspec = "";
168 else 173 else
169 fontspec = sprintf ("font \"%s,%d\"", f, s); 174 fontspec = sprintf ("font \"%s,%d\"", f, s);
170 endif 175 endif
171 fprintf (plot_stream, "set zlabel \"%s\" %s %s", 176 fprintf (plot_stream, "set zlabel \"%s\" %s %s %s",
172 undo_string_escapes (tt), colorspec, fontspec); 177 undo_string_escapes (tt), colorspec, fontspec,
178 __do_enhanced_option__ (enhanced, t));
173 if (have_newer_gnuplot) 179 if (have_newer_gnuplot)
174 ## Rotation of zlabel not yet support by gnuplot as of 4.2, but 180 ## Rotation of zlabel not yet support by gnuplot as of 4.2, but
175 ## there is no message about it. 181 ## there is no message about it.
176 fprintf (plot_stream, " rotate by %f;\n", angle); 182 fprintf (plot_stream, " rotate by %f;\n", angle);
177 endif 183 endif
982 colorspec = get_text_colorspec (color, mono); 988 colorspec = get_text_colorspec (color, mono);
983 endif 989 endif
984 990
985 if (nd == 3) 991 if (nd == 3)
986 fprintf (plot_stream, 992 fprintf (plot_stream,
987 "set label \"%s\" at %s %.15g,%.15g,%.15g %s rotate by %f %s front %s;\n", 993 "set label \"%s\" at %s %.15g,%.15g,%.15g %s rotate by %f %s %s front %s;\n",
988 undo_string_escapes (label), units, lpos(1), 994 undo_string_escapes (label), units, lpos(1),
989 lpos(2), lpos(3), halign, angle, fontspec, colorspec); 995 lpos(2), lpos(3), halign, angle, fontspec,
996 __do_enhanced_option__ (enhanced, obj), colorspec);
990 else 997 else
991 fprintf (plot_stream, 998 fprintf (plot_stream,
992 "set label \"%s\" at %s %.15g,%.15g %s rotate by %f %s front %s;\n", 999 "set label \"%s\" at %s %.15g,%.15g %s rotate by %f %s %s front %s;\n",
993 undo_string_escapes (label), units, 1000 undo_string_escapes (label), units,
994 lpos(1), lpos(2), halign, angle, fontspec, colorspec); 1001 lpos(1), lpos(2), halign, angle, fontspec,
1002 __do_enhanced_option__ (enhanced, obj), colorspec);
995 endif 1003 endif
996 1004
997 otherwise 1005 otherwise
998 error ("__go_draw_axes__: unknown object class, %s", 1006 error ("__go_draw_axes__: unknown object class, %s",
999 obj.type); 1007 obj.type);
2021 sz = sz .* [0.07, 1]; 2029 sz = sz .* [0.07, 1];
2022 pos([1,3]) = scl; 2030 pos([1,3]) = scl;
2023 endif 2031 endif
2024 2032
2025 endfunction 2033 endfunction
2034
2035 function retval = __do_enhanced_option__ (enhanced, obj)
2036 retval = "";
2037 if (enhanced)
2038 if (strcmpi (obj.interpreter, "none"))
2039 retval = "noenhanced";
2040 else
2041 retval = "enhanced";
2042 endif
2043 endif
2044 endfunction