Proposed 'position' change
Daniel J Sebald
daniel.sebald at ieee.org
Thu Oct 2 23:16:50 CDT 2008
I'm not sure exactly how 'position' in the Matryoska Tags is supposed to be handled. Right now it appears to be forced to [0 0 1 1] inside __go_draw_axes__.m. I'd like to propose the change in the attached patch.
The issue is that there isn't much control of the plot borders right now. I wanted to do something like
pos = get(gca, 'position')
pos(1) = 0.1
set(gca, 'position', pos);
in order to get some subplots to line up nicely along all vertical borders. Instead Octave does nothing in response to the position, for the reason described above.
The change I propose is to define 'NaN' to mean "auto-compute" the borders. If a position value is not NaN, gnuplot is instructed to use the specified margin. With this interpretation and a default of [NaN NaN NaN NaN] the above sequence of commands would produce
plot(...)
pos = get(gca, 'position')
pos = [NaN NaN NaN NaN]
pos(1) = 0.1
pos = [0.1 NaN NaN NaN]
which means that the left margin is fixed and the rest are auto-computed by gnuplot. Basically, calling set() achieves what I wanted. (If the actual values were returned in the pos array, that would still work too.)
There are a couple snags. First, does pos mean [lmargin bmargin rmargin tmargin]? Or [lmargin bmargin width height]? The latter is problematic because there really is no way of having auto-computed quantities for the right and top borders. (Auto-computing a width makes little sense.) Second, it would be nice if gnuplot could return the actual values so that the NaN isn't needed. Would gnuplot indicating the actual quantities help in any way? E.g.,
gnuplot> show margin
lmargin is set to 0.15
bmargin is computed automatically (0.04)
rmargin is computed automatically (0.95)
tmargin is computed automatically (0.95)
which I could propose as a change to gnuplot?
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: position_djs_2oct2008.patch
Type: text/x-patch
Size: 1943 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20081002/57ab8737/attachment.bin
More information about the Octave-maintainers
mailing list