Michael Hearne wrote:
> All: I'm trying to make a map (using Basemap), and plot names of cities
> on that map. I'd like to avoid "collisions" of city names (where the
> bounding boxes of the text objects would overlap), but I'm having
> trouble figuring out how I can do this without actually drawing the text
> on the figure.
>
> I found this thread:
>
> http://osdir.com/ml/python.matplotlib.general/2005-02/msg00174.html
>
> which describes how to do it _after_ drawing the text on the plot. This
> would only be useful to me if there were some way to un-draw the text,
> which isn't something I know how to do either.
>
Michael: Each Text instance that you add to the plot has a remove
method that you can call to 'undraw' it.
-Jeff
> Figure resizing is not a problem for my application.
>
> Java has a FontMetrics class, which tells you how big a string will be
> in a given font - is there an equivalent for Matplotlib?
>
> --Mike
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
|