Re: [Matplotlib-users] Memory usage when plotting sequental figures

2013-05-28 Thread Albert Kottke
Correct. On Tue, May 28, 2013 at 9:42 AM, zetah wrote: > Albert Kottke wrote: > > > >I had this problem as well. I think my solution was to tell the > >garbage collector to collect. > > > >import gc > >import numpy as np > >import matplot

Re: [Matplotlib-users] Memory usage when plotting sequental figures

2013-05-28 Thread Albert Kottke
I had this problem as well. I think my solution was to tell the garbage collector to collect. import gc import numpy as np import matplotlib.pyplot as plt def draw_fig(arr, fn): fig = plt.figure() ax = fig.add_subplot(111) ax.contourf(arr) plt.savefig(fn) plt.close(fig) gc

[Matplotlib-users] Clearing figures from memory

2012-03-23 Thread Albert Kottke
I am having problems clearing figures from memory. After saving the figure, I use pyplot.close() on the figure handle and then del all of the data and figure, as shown here: fig.savefig('plots/%(record_id)05i' % recording) plt.close(fig) del accel, fourier_amp, fig, time, disp gc.collect() Despi

[Matplotlib-users] [Basemap] Using a geotiff from seamless.usgs.gov as a background

2011-08-22 Thread Albert Kottke
As the subject states, I am trying to use a geotiff (shaded relief) that I have downloaded from seamless.usgs.gov as the background in a map. Mostly I am just confused about the seamless image projection and bounds. The metadata defines the latitude of the top and bottom, and longitude of the left