John Hunter wrote:
> On Tue, Nov 18, 2008 at 9:41 AM, Hrafnkell Pálsson <[EMAIL PROTECTED]> wrote:
>   
>> Ok, I tried your last suggestion and sure enough it worked.
>> But it turns out to solve only half of my problem. I'd like to be able to
>> restore the background (using the Agg backend) and then use it further, i.e.
>> plot on it, without it disappearing.
>>
>> Elaborating on my real use case, what I want to do is to make a Basemap
>> instance, plot the coastlines and other things that are constant in time
>> (put marker on the maps for cities, watermark the figure, draw meridians and
>> parallels and so on) and save that as a background.
>> I would then restore this background and plot "the weather" (open and filled
>> contours, quivers and barbs) onto it. I typically have data for some dozens
>> of timesteps, so I'd be restoring the background many times. Each time I'd
>>     
>
> This should work fine as long as you make the figure frame and axes
> frame invisible.  Basically, you need to create the figure background,
> and the axes background with all the grid lines, tick labels,
> coastlines, etc, save it, and then for the new figure make sure all
> the stuff you have saved is turned off.  I am not a basemap user, but
> I know all this stuff is ultimately exposed.  Eg for a plain vanilla
> axes, you would do
>
>
>   fig1 = figure(frameon=False)
>   ax1 = fig1.add_subplot(111)
>
>
>   fig = figure(frameon=False)
>   ax = fig.add_subplot(111, frameon=false, xticks=[], yticks=[])
>   fig.canvas.restore_region(background)
>
>
> This will turn off the rendering of both the background rectangle as
> well as all the ticks and their associated labels, ticklines and
> gridlines.  Perhaps Jeff can advise you vis-a-vis the basemap api what
> the equivalent is
>
>
>   
Don't see why this wouldn't work fine with basemap, as long as you don't 
call the drawmapboundary method (which will set the axes frame on).

-Jeff

-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : [EMAIL PROTECTED]
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg



-------------------------------------------------------------------------
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