SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Jae-Joon L. <lee...@gm...> - 2008年12月17日 06:06:36
Hello,
I'm thinking about slightly modifying the draw() method of the Axes
class, so that user can optionally
calculate the position of the axes at drawing time. It may be
considered as a general version of the apply_aspect() method.
For example, instead of "self.apply_aspect()" call in the draw
function, we may put something like below.
if self._axes_locator:
 self._axes_locator(self, renderer)
else:
 self.apply_aspect()
where self._axes_locator is a (user-supplied) callable object which
takes the axes itself and the renderer as arguments.
I have been running a similar version of this, and I found it quite
helpful especially when drawing images. Here are a few of my use
cases.
 * colorbar (or any kind of axes) whose location is adjusted to match
the image location (which is calculated on the fly with apply_aspect).
 * grid of images (of same size) with fixed space between them.
I guess the needed change is not significant and I don't think it will
interfere with other things of Axes class.
So, how do others think?
Regards,
-JJ
From: Jae-Joon L. <lee...@gm...> - 2008年12月19日 22:44:02
As there was no explicit objection, I just submit this to the trunk.
The change in Axes class is rather minor, and I hope others don't
mind.
I added two examples. The examples are rather lengthy, because they
are actually helper classes that I have been playing with (and it is
not well documented).
Here is screenshots.
http://dl.getdropbox.com/u/178748/mpl_aux/axes_divider.png
http://dl.getdropbox.com/u/178748/mpl_aux/axes_grid.png
I hope others find this useful.
Regards,
-JJ
On Wed, Dec 17, 2008 at 1:06 AM, Jae-Joon Lee <lee...@gm...> wrote:
> Hello,
>
> I'm thinking about slightly modifying the draw() method of the Axes
> class, so that user can optionally
> calculate the position of the axes at drawing time. It may be
> considered as a general version of the apply_aspect() method.
>
> For example, instead of "self.apply_aspect()" call in the draw
> function, we may put something like below.
>
> if self._axes_locator:
> self._axes_locator(self, renderer)
> else:
> self.apply_aspect()
>
> where self._axes_locator is a (user-supplied) callable object which
> takes the axes itself and the renderer as arguments.
> I have been running a similar version of this, and I found it quite
> helpful especially when drawing images. Here are a few of my use
> cases.
>
> * colorbar (or any kind of axes) whose location is adjusted to match
> the image location (which is calculated on the fly with apply_aspect).
> * grid of images (of same size) with fixed space between them.
>
> I guess the needed change is not significant and I don't think it will
> interfere with other things of Axes class.
> So, how do others think?
>
> Regards,
>
> -JJ
>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /