new subplot bug
Ben Abbott
bpabbott at mac.com
Wed Feb 18 10:31:17 CST 2009
On Feb 18, 2009, at 7:04 AM, Ben Abbott wrote:
> I found the problem. My changeset that added the "compatible"
> outerposition is responsible. I'll take a look.
>
> Ben
>
> On Feb 17, 2009, at 10:42 PM, John W. Eaton wrote:
>
>> With the current sources, the following is now only showing the last
>> plot. It should show all three. Is it just me, or can someone
>> duplicate this problem? Any clues about a fix? I don't really know
>> how subplot is supposed to work now.
>>
>> x = -10:0.1:10;
>> for i = 1:3
>> subplot (3, 1, i);
>> plot (x, sin (x));
>> endfor
>>
>> jwe
>
I found a few errors in my prior changeset.
http://hg.savannah.gnu.org/hgweb/octave/rev/4142982c66c6
The most severe were not offsetting the outerposition from the postion
property, and calculating the lower/bottom inset correctly.
There are some surprises with the proprietary solution. First, the
outerposition properties for subplot with more than 4 rows overlap. In
Octave's implementation this results in new subplots deleting
neighboring ones.
I fixed that by trigger deletion when the position properties overlap.
A second surprise is the interaction of Matlab's parser and the
subplot command. See the example below.
>> subplot(1,5,1);get(gca,'position')
ans = 0.13 0.11 0.12374 0.815
>> subplot(1,5,1);
>> get(gca,'position')
ans = 0.13 0.11 0.12132 0.815
I characterized the proprietary behavior using scripts. Thus, it
presently respects the first example. I verified the propriety
behavior for Matlab 2007b as well as for 2008b. I'd prefer we not try
to duplicate this behavior.
As I already missed several errors, please check this over. If it is
ok, please push (I won't be able to until later).
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeset-subplot.patch
Type: application/octet-stream
Size: 2391 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20090218/409bac20/attachment.obj
-------------- next part --------------
More information about the Octave-maintainers
mailing list