Re: [Matplotlib-users] Save a plot background

2008-12-01 Thread Jeff Whitaker
Hrafnkell Pálsson wrote: > Any chance of further help? > John? > > Hrafnkell > Hrafnkell: I'm pretty sure this is a fundamental limitation of canvas.restore_region - everything gets draw on top of it. If I recall correctly, you'd like to save the map with coastlines drawn, and just redraw co

Re: [Matplotlib-users] Save a plot background

2008-12-01 Thread Hrafnkell Pálsson
Any chance of further help? John? Hrafnkell -- View this message in context: http://www.nabble.com/Save-a-plot-background-tp20519596p20771515.html Sent from the matplotlib - users mailing list archive at Nabble.com. - Thi

Re: [Matplotlib-users] Save a plot background

2008-11-20 Thread Jeff Whitaker
Hrafnkell Pálsson wrote: > Jeff Whitaker wrote: > >> Hrafnkell: >> >> Had some time this morning, so I used John's method to create a working >> Basemap example: >> >> import matplotlib >> matplotlib.use('Agg') >> from mpl_toolkits.basemap import Basemap >> import matplotlib.pyplot as plt >> >>

Re: [Matplotlib-users] Save a plot background

2008-11-20 Thread Hrafnkell Pálsson
Jeff Whitaker wrote: > > Hrafnkell: > > Had some time this morning, so I used John's method to create a working > Basemap example: > > import matplotlib > matplotlib.use('Agg') > from mpl_toolkits.basemap import Basemap > import matplotlib.pyplot as plt > > # this example shows how to save a

Re: [Matplotlib-users] Save a plot background

2008-11-20 Thread Jeff Whitaker
Hrafnkell Pálsson wrote: > > >> 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 >> >> > > Ok, I tested your

Re: [Matplotlib-users] Save a plot background

2008-11-19 Thread Jeff Whitaker
Hrafnkell Pálsson wrote: > > >> 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 >> >> > > Ok, I tested your

Re: [Matplotlib-users] Save a plot background

2008-11-19 Thread Hrafnkell Pálsson
> 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 > Ok, I tested your example and see what you mean. But if I und

Re: [Matplotlib-users] Save a plot background

2008-11-18 Thread Jeff Whitaker
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 t

Re: [Matplotlib-users] Save a plot background

2008-11-18 Thread John Hunter
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. >

Re: [Matplotlib-users] Save a plot background

2008-11-18 Thread Hrafnkell Pálsson
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 d

Re: [Matplotlib-users] Save a plot background

2008-11-17 Thread John Hunter
On Mon, Nov 17, 2008 at 8:05 AM, Hrafnkell Pálsson <[EMAIL PROTECTED]> wrote: > > Hi > > I tried you suggestions but it didn't work out for me. > In the following code I try to save the axes and the grid from figure1 into > buffer and then restore it on figure2 but figure2.png turns out to be of an

Re: [Matplotlib-users] Save a plot background

2008-11-17 Thread John Hunter
On Mon, Nov 17, 2008 at 1:50 PM, Jae-Joon Lee <[EMAIL PROTECTED]> wrote: > I think the savefig() command calls draw() internally, doesn't it? Ahh yes. The copy_from_bbox / restore_region was conceived as an aid to animation and I don't think I've used it in the context of savefig where none of th

Re: [Matplotlib-users] Save a plot background

2008-11-17 Thread Jae-Joon Lee
I think the savefig() command calls draw() internally, doesn't it? So, I guess the restore_region() command comes before the draw() call, i.e., it has no effect for the saved figure. One way I can think of is to save the agg buffer without redrawing it. It seems work. --- imp

Re: [Matplotlib-users] Save a plot background

2008-11-17 Thread John Hunter
On Mon, Nov 17, 2008 at 8:05 AM, Hrafnkell Pálsson <[EMAIL PROTECTED]> wrote: > > Hi > > I tried you suggestions but it didn't work out for me. > In the following code I try to save the axes and the grid from figure1 into > buffer and then restore it on figure2 but figure2.png turns out to be of an

Re: [Matplotlib-users] Save a plot background

2008-11-17 Thread Hrafnkell Pálsson
Hi I tried you suggestions but it didn't work out for me. In the following code I try to save the axes and the grid from figure1 into buffer and then restore it on figure2 but figure2.png turns out to be of an empty canvas. #!/usr/bin/env /opt/python/bin/python # encoding: utf-8 import matplotli

Re: [Matplotlib-users] Save a plot background

2008-11-16 Thread John Hunter
On Sat, Nov 15, 2008 at 3:23 PM, Hrafnkell Pálsson <[EMAIL PROTECTED]> wrote: > > Hi > I haven't managed to save a plot background into buffer to be able to > restore it later. > I use matplotlib to draw weather maps (see www.belgingur.is), and though the > weather constantly changes the outlines o

[Matplotlib-users] Save a plot background

2008-11-16 Thread Hrafnkell Pálsson
Hi I haven't managed to save a plot background into buffer to be able to restore it later. I use matplotlib to draw weather maps (see www.belgingur.is), and though the weather constantly changes the outlines of the countries are the same for every picture. Currently I plot the coastlines anew for