octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

set axes position


From: Pantxo Diribarne
Subject: set axes position
Date: Sun, 28 Oct 2012 15:17:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1

While trying to fix some axes position issues in struct2hdl.m (in current developper sources) I noticed what seems to be a bug in set function. Consider the following code that copies the position related properties from one axes to another :

figure (1); clf
plot (1:10)
legend ('toto')
prp.position = get (gca, 'position');
prp.outerposition = get (gca, 'outerposition');
prp.activepositionproperty = get (gca,'activepositionproperty');
disp (prp)

##set props using a PV structure
figure (2);
ax = axes ();
set (ax, prp);
prpout.position = get (ax, 'position');
prpout.outerposition = get (ax, 'outerposition');
prpout.activepositionproperty = get (ax, 'activepositionproperty');
disp (prpout)

##set props one by one
figure (3);
ax = axes ();
fields = fieldnames(prp)
for ii = 1:numel (fields)
  set (ax, fields{ii}, prp.(fields{ii}));
endfor
prpout.position = get (ax, 'position');
prpout.outerposition = get (ax, 'outerposition');
prpout.activepositionproperty = get (ax, 'activepositionproperty');
disp (prpout)


The final position of the clone axes is not properly set if use PV structure method. I think with this method, the "set" function should check the actual values of the requested properties. The second "one by one" method works here, but it is not an option for struct2hdl: setting the nth property may change one of the previously set ones (if they depend on one another).

Should I file a bug report?

Pantxo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]