From: Baptiste C. <bap...@al...> - 2005-01-23 22:00:43
|
Hello, I tried to improve the way of plotting two scales (cf examples/two_scales.py). The attached patch contains the following changes: in axis.py: allow right side label, so both y axes can get one. axis instances get a new property: label_position, which is left or right for yaxis, top or bottom for xaxis. in axes.py: a new Axes subclass (TwinAxes) that shares the x axis with another. Transforms are set accordingly (lazy values for x lims are shared). This avoids having to change the xlim or xlabel (and so on) 2 times. in pylab.py: a new command (twin) that returns the twin of an axes instance (the current one by default), thus making it into a two scales plot. How to use: see the new examples/two_scales.py for the typical use case. Cheers, BC |