Mercurial > hg > octave-max
comparison scripts/plot/__go_draw_axes__.m @ 10911:da90c16fbe84
__go_draw_axes__.m: Revert erroneous portion of changeset 10910 40cf7cc4ea62.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Wed, 25 Aug 2010 12:36:23 -0400 |
parents | 40cf7cc4ea62 |
children | 9abc67b4bd4f |
comparison
equal
deleted
inserted
replaced
10910:40cf7cc4ea62 | 10911:da90c16fbe84 |
---|---|
21 ## Undocumented internal function. | 21 ## Undocumented internal function. |
22 ## @end deftypefn | 22 ## @end deftypefn |
23 | 23 |
24 ## Author: jwe | 24 ## Author: jwe |
25 | 25 |
26 function __go_draw_axes__ (h, plot_stream, enhanced, mono, bg_is_set) | 26 function __go_draw_axes__ (h, plot_stream, enhanced, mono, implicit_margin, bg_is_set) |
27 | 27 |
28 if (nargin >= 4 && nargin <= 6) | 28 if (nargin >= 4 && nargin <= 6) |
29 | 29 |
30 showhiddenhandles = get (0, "showhiddenhandles"); | 30 showhiddenhandles = get (0, "showhiddenhandles"); |
31 unwind_protect | 31 unwind_protect |
49 if (strcmpi (axis_obj.plotboxaspectratiomode, "manual")) | 49 if (strcmpi (axis_obj.plotboxaspectratiomode, "manual")) |
50 pos = __actual_axis_position__ (axis_obj); | 50 pos = __actual_axis_position__ (axis_obj); |
51 else | 51 else |
52 pos = axis_obj.position; | 52 pos = axis_obj.position; |
53 endif | 53 endif |
54 pos(1:2) = pos(1:2) - implicit_margin .* [0.75, 0.5]; | |
54 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) | 55 if (__gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) |
55 if (nd == 2 || all (mod (axis_obj.view, 90) == 0)) | 56 if (nd == 2 || all (mod (axis_obj.view, 90) == 0)) |
56 x = [1, 1]; | 57 x = [1, 1]; |
57 else | 58 else |
58 ## 3D plots need to be sized down to fit in the window. | 59 ## 3D plots need to be sized down to fit in the window. |
59 x = 1.0 ./ sqrt([2, 2.5]); | 60 x = 1.0 ./ sqrt([2, 2.5]); |
60 endif | 61 endif |
61 fprintf (plot_stream, "set tmargin screen %.15g;\n", | 62 fprintf (plot_stream, "set tmargin screen %.15g;\n", pos(2)+pos(4)/2+x(2)*pos(4)/2); |
62 pos(2)+pos(4)/2+x(2)*pos(4)/2); | 63 fprintf (plot_stream, "set bmargin screen %.15g;\n", pos(2)+pos(4)/2-x(2)*pos(4)/2); |
63 fprintf (plot_stream, "set bmargin screen %.15g;\n", | 64 fprintf (plot_stream, "set lmargin screen %.15g;\n", pos(1)+pos(3)/2-x(1)*pos(3)/2); |
64 pos(2)+pos(4)/2-x(2)*pos(4)/2); | 65 fprintf (plot_stream, "set rmargin screen %.15g;\n", pos(1)+pos(3)/2+x(1)*pos(3)/2); |
65 fprintf (plot_stream, "set lmargin screen %.15g;\n", | |
66 pos(1)+pos(3)/2-x(1)*pos(3)/2); | |
67 fprintf (plot_stream, "set rmargin screen %.15g;\n", | |
68 pos(1)+pos(3)/2+x(1)*pos(3)/2); | |
69 else | 66 else |
70 ## FIXME -- nothing should change for gnuplot 4.2.x. | 67 ## FIXME -- nothing should change for gnuplot 4.2.x. |
71 fprintf (plot_stream, "set tmargin 0;\n"); | 68 fprintf (plot_stream, "set tmargin 0;\n"); |
72 fprintf (plot_stream, "set bmargin 0;\n"); | 69 fprintf (plot_stream, "set bmargin 0;\n"); |
73 fprintf (plot_stream, "set lmargin 0;\n"); | 70 fprintf (plot_stream, "set lmargin 0;\n"); |
102 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); | 99 [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string"); |
103 fontspec = create_fontspec (f, s, gnuplot_term); | 100 fontspec = create_fontspec (f, s, gnuplot_term); |
104 fprintf (plot_stream, "set title \"%s\" %s %s", | 101 fprintf (plot_stream, "set title \"%s\" %s %s", |
105 undo_string_escapes (tt), fontspec, | 102 undo_string_escapes (tt), fontspec, |
106 __do_enhanced_option__ (enhanced, t)); | 103 __do_enhanced_option__ (enhanced, t)); |
107 if (nd == 3 | 104 if (nd == 3 && __gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) |
108 && __gnuplot_has_feature__ ("screen_coordinates_for_{lrtb}margin")) | |
109 fprintf (plot_stream, " offset screen 0, screen %.3f;\n", pos(4)/5); | 105 fprintf (plot_stream, " offset screen 0, screen %.3f;\n", pos(4)/5); |
110 else | 106 else |
111 fprintf (plot_stream, ";\n"); | 107 fprintf (plot_stream, ";\n"); |
112 endif | 108 endif |
113 endif | 109 endif |