Re: [Matplotlib-users] Basemap white space

2010-04-13 Thread Friedrich Romstedt
2010/4/12 Filipe Pires Alvarenga Fernandes : > Thanks for point TKinter to me. However, I'm stuck again. > > I've tried two approaches, one is following what you suggested: > > """ Tkinter  """ > import Tkinter as tk > root = tk.Tk() > from PIL import Image, ImageTk > image = ImageTk.PhotoImage(Ima

Re: [Matplotlib-users] Basemap white space

2010-04-12 Thread Filipe Pires Alvarenga Fernandes
Thanks for point TKinter to me. However, I'm stuck again. I've tried two approaches, one is following what you suggested: """ Tkinter """ import Tkinter as tk root = tk.Tk() from PIL import Image, ImageTk image = ImageTk.PhotoImage(Image.open('map.png')) # load saved image #image = ImageTk.Photo

Re: [Matplotlib-users] Basemap white space

2010-04-08 Thread Friedrich Romstedt
2010/4/8 Filipe Fernandes : > BTW: What I meant by limitation is the fact that Agg has no GUI like the > nice QT window I was using before. The users of this script have no > experience with scripting languages and enjoyed choosing the format and > filename using a GUI interface. I'm quite convinc

Re: [Matplotlib-users] Basemap white space

2010-04-08 Thread Filipe Fernandes
Sorry, my bad. I always hit reply without checking... it is not the first time did that, Here is the solution for the list sake: """ trim image """ import StringIO, Image imgdata = StringIO.StringIO() fig.savefig(imgdata, dpi=300, format='png') imgdata.seek(0) im = Image.open(imgdata) def trim(i

Re: [Matplotlib-users] Basemap white space

2010-03-30 Thread Friedrich Romstedt
2010/3/30 Filipe Pires Alvarenga Fernandes : > However, my knowledge of python is very limited, even though I think I > understood what you suggested I do not know how to get the shape (of > the figure?) for this part: > fig.set_size_inches(float(shape[0]) / dpi, float(shape[1]) / dpi) > > err

Re: [Matplotlib-users] Basemap white space

2010-03-30 Thread Filipe Pires Alvarenga Fernandes
Thanks Friedrich, However, my knowledge of python is very limited, even though I think I understood what you suggested I do not know how to get the shape (of the figure?) for this part: >>> fig.set_size_inches(float(shape[0]) / dpi, float(shape[1]) / dpi) error is: Traceback (most recent call l

Re: [Matplotlib-users] Basemap white space

2010-03-28 Thread Friedrich Romstedt
2010/3/28 Filipe Pires Alvarenga Fernandes : > Hello list > I've trying for a while a "python only" solution to remove white spaces that > Basemap generate to keep the aspect ratio. I found these two threads that > explain the issue better: I think maybe you can make use of the Agg Backend to ach

[Matplotlib-users] Basemap white space

2010-03-27 Thread Filipe Pires Alvarenga Fernandes
Hello list I've trying for a while a "python only" solution to remove white spaces that Basemap generate to keep the aspect ratio. I found these two threads that explain the issue better: http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg14430.html http://www.mail-archive.com