Hello,

I started off with the Polygon plotting example of the basemap toolkit as I
want to visualize Radar data with GoogleEarth.
I have a polygon shapefile and another data file in which I have one value
for each of the polygons.
I do the basemap.read_shapefile and the axes.add_patch stuff once in the
beginning, keeping a list of the polygon-instances.
Then, for each data file I set the face color of the polygons according to
their respective value and call pyplot.savefig() to save to a png file. This
way I have to do the time and memory consuming task of reading the shapefile
and producing the polygon patches (~40000) only once at the beginning.

That worked splendidly.

Now I wanted some data values to be transparent (so that only rainfall is
actually drawn). So I thought about using set_visible(None) on the
respective polygons.
That seems to work as well, but now I have the problem, that wherever a
polygon becomes invisible, the patch from the previous run remains visible.

So apparently, the figure's canvas (or whatever object is responsible for
the final image pixels) is not initialized between subsequent calls to
savefig.
I searched a bit through the code of figure.py, backend_bases.py,
backend_agg.py but didn't find any method that looked like it would erase
the canvas.
If I do clf() then savefig() always saves the same image over and over
again. I suppose it's because no new data is drawn to the canvas in this
case.

Any ideas, how to solve this?

Thank you for your help


Thomas


-------------------------------------------------------------------------
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-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to