Thanks John,
I'll work on the revisions.

>
> +    def set_offset(self, xy):
> +        """
> +        set offset of the container.
> +
> +        Accept : tuple of x,y cooridnate in display units.
>
> Is it worthwhile to allow other coordinate systems for the offsets
> (points, data) or would this complicate the code with little benefit?
> On a quick read-thru, it looks like we would just need to supply an
> optional transform arg and transform the offset if necessary, so the
> implementation would be pretty clean.  I see that offset can be
> callable -- is this the mechanism you intended to handle this case?
>

My original intention with the OffsetBox was to only support the
translation in the display coordinates. VPacker and HPacker even
doesn't use the transformation explicitly. One of the reason for this
was that the size of the Text objects does not depends on the
transformation. I guess in most cases, children will have a fixed
offset relative to their parent container. Introducing an arbitrary
transformation between the child and the parent may make things
complicated. On the other hand, the top most container may have its
own transformation. In the use case I considered (legend), the size of
the box is only known at the drawing time and the offset of the box
needs to be calculated on the fly (e.g., using the size of the box and
the anchor point). The reason that the offset can be a callable object
is to support such situation.
As implementing an optional transformation should be trivial, I'll
just go ahead an work on it. But it seems not clear to me how to
approach this without any specific use case given.



>
> +ax1.plot([1], label="multi\nline")
>
> For multi-line|, it appears that we are getting the default "baseline"
> vertical alignment but for the legend, 'center' would probably be more
> appropriate.  Any idea how to get that to work?
>

We may do it by adjusting the baseline of the multi-line text. In the
current implementation, the baseline of the multi-line text is set to
the baseline of the first line. It may not give the perfect
center-align, but will give a reasonable results. The other way is to
treat the multiline text separately during the packing. But this will
need more work as the current Packer class does not know whether its
child is multi-line text or not. I'll see what I can do.

Regards,

-JJ

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to