TextCollection

Hi,

Has anyone ever thought about creating a TextCollection class? The purpose would be similar to the other collections, to group a bunch of text objects with similar properties. This probably couldn't inherit from Collection as of now though, since Collection assumes things like edgecolor and facecolor. The bigger question to me is, could the backends make use of this to any improvement? Or would this simply serve as an API to eliminate having to loop yourself (which would pretty much make this useless).

My own personal use case is (once again) in meteorology, where we do station plots. This involves printing the actual value of observed variables relative to the location of the station. This isn't hard to do right now (especially since I have offset_copy back, thanks Mike!). I just wasn't sure if the batch functionality of a Collection might serve some purpose to the users at large.

Thoughts?

Ryan

···

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

I've thought of it many times and it would definitely be useful, eg
for tick labels. Treating every label as a separate instance
definitely slows things down.

JDH

···

On Mon, Jul 21, 2008 at 11:35 PM, Ryan May <rmay31@...149...> wrote:

Hi,

Has anyone ever thought about creating a TextCollection class? The
purpose would be similar to the other collections, to group a bunch of
text objects with similar properties. This probably couldn't inherit
from Collection as of now though, since Collection assumes things like
edgecolor and facecolor. The bigger question to me is, could the
backends make use of this to any improvement? Or would this simply
serve as an API to eliminate having to loop yourself (which would pretty
much make this useless).

My own personal use case is (once again) in meteorology, where we do
station plots. This involves printing the actual value of observed
variables relative to the location of the station. This isn't hard to
do right now (especially since I have offset_copy back, thanks Mike!).
I just wasn't sure if the batch functionality of a Collection might
serve some purpose to the users at large.

John Hunter wrote:

···

On Mon, Jul 21, 2008 at 11:35 PM, Ryan May <rmay31@...149...> wrote:

Hi,

Has anyone ever thought about creating a TextCollection class? The
purpose would be similar to the other collections, to group a bunch of
text objects with similar properties. This probably couldn't inherit
from Collection as of now though, since Collection assumes things like
edgecolor and facecolor. The bigger question to me is, could the
backends make use of this to any improvement? Or would this simply
serve as an API to eliminate having to loop yourself (which would pretty
much make this useless).

My own personal use case is (once again) in meteorology, where we do
station plots. This involves printing the actual value of observed
variables relative to the location of the station. This isn't hard to
do right now (especially since I have offset_copy back, thanks Mike!).
I just wasn't sure if the batch functionality of a Collection might
serve some purpose to the users at large.

I've thought of it many times and it would definitely be useful, eg
for tick labels. Treating every label as a separate instance
definitely slows things down.

Ok, good to know. I'll put it on my todo list then. Do you think this can inherit from Collection at all? It seemed like a lot of the methods in the Collection base class were specific to polygons or other geometry and don't really make sense in the case of text.

Anyone else have thoughts on how this should be implemented?

Ryan

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

There's some precedent for treating text as a collection of paths; for instance, many eps exporters allow 'as path' or 'as text' as options.

I think most vector drawing apps treat the text color as a face color, and support an additional edge color for doing outline effects. So on that conceptual basis a collection seems appropriate, even if the renderer treats it differently than a polygon.

-Eric

···

On Jul 22, 2008, at 6:26 PM, Ryan May <rmay31@...149...> wrote:

John Hunter wrote:

On Mon, Jul 21, 2008 at 11:35 PM, Ryan May <rmay31@...149...> wrote:

Hi,

Has anyone ever thought about creating a TextCollection class? The
purpose would be similar to the other collections, to group a bunch of
text objects with similar properties. This probably couldn't inherit
from Collection as of now though, since Collection assumes things like
edgecolor and facecolor. The bigger question to me is, could the
backends make use of this to any improvement? Or would this simply
serve as an API to eliminate having to loop yourself (which would pretty
much make this useless).

My own personal use case is (once again) in meteorology, where we do
station plots. This involves printing the actual value of observed
variables relative to the location of the station. This isn't hard to
do right now (especially since I have offset_copy back, thanks Mike!).
I just wasn't sure if the batch functionality of a Collection might
serve some purpose to the users at large.

I've thought of it many times and it would definitely be useful, eg
for tick labels. Treating every label as a separate instance
definitely slows things down.

Ok, good to know. I'll put it on my todo list then. Do you think this
can inherit from Collection at all? It seemed like a lot of the methods
in the Collection base class were specific to polygons or other geometry
and don't really make sense in the case of text.

-------------------------