[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compatible plotyy and colorbar (or Confusion about Position, OuterPositi
From: |
David Bateman |
Subject: |
Compatible plotyy and colorbar (or Confusion about Position, OuterPosition and ActivePositionProperty) |
Date: |
Sun, 12 Oct 2008 20:35:26 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.16 (X11/20080724) |
My colorbar/plotyy changes were recently added, and when implementing it
I had some issues with the treatment of the position, outerposition and
activepositionproperty properties of axes objects.
The behavior in matlab is described on the page
http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f1-32495.html
The actual size of the plot window is always determined by Position,
whereas the space allocated for the plot window and text is always
determined by OuterPosition. The ActivePositionProperty property is only
used to determine how the difference between Position and OuterPosition
are changed if the window is resized, so as gnuplot at the moment gives
no means to feedback this information (or rather octave's interface to
gnuplot), ActivePositionProperty is of no use.
Now how Octave treated these values before my change is that
* Octave's gnuplot interface uses OuterPosition in almost all cases to
define the position as gnuplot's origin/size paradigm bests fits with
use of OuterPosition. The exception is the plotyy function where
currently ActivePositionProperty is abused to force gnuplot to have
overlaying plots.
* The graphics.cc (void axes::properties::sync_positions (void))
function maintains a constant relationship between Position and
OuterPosition. This is incorrect as adding a colorbar maintains the
OuterPosition and adjusts position.
* The subplot function uses the OuterPosition property to recognize
subplots that are to an existing axis.
So the correct implementation of the colorbar/plotyy function means that
we'll have to fix this to be more Matlab like. Basically what this means
is that
* Octave should base its decision on the window placement in the
backends solely on the position property of the axis. This means that
the intelligence for the axis size needs to be placed in Octave and not
gnuplot.
* The synchronization code between the position and outerposition
properties should be disabled till it is more intelligent and capable of
handling colorbars. For now this means that space for the title, axis
labels, legend, etc need to be hard coded into the default position of
the axes.
I did that in the applied patch and fixed a couple of other issues and
now have a fully working plotyy and colorbar command. In particular the
mathworks example
surf(peaks(30))
colorbar('YTickLabel',{'Freezing','Cold','Cool','Neutral','Warm','Hot','Burning','Nuclear'})
works as expected when it didn't previously. However, the confusion
about the Position, OuterPosition and ActivePositionProperty remains in
the sense that the intelligence to calculate the size of the plot to
allow for the axis labels, etc isn't in Octave and so its possible to
make the plots label either fall outside the boundaries of the plot. At
some point, we'll need to add this intelligence to Octave.
Regards
David
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
--
David Bateman address@hidden
35 rue Gambetta +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)
- Compatible plotyy and colorbar (or Confusion about Position, OuterPosition and ActivePositionProperty),
David Bateman <=