I'm looping over several files (about 1000) to produce a vector field
plot for each data file I have. Doing this with the MacOSX backend
appears to chew memory. My guess as to the source of the problem is
the 'savefig' function (or possibly the way the MacOSX backend handles
the saving of plots).
I opened Activity Monitor to watch the usage of memory increase. Below
is code that recreates the problem.
[start]
import matplotlib
matplotlib.use('macosx')
matplotlib.rc('font',**{'family':'serif','serif':['Computer Modern
Roman']})
matplotlib.rc('text', usetex=True)
from pylab import *
i = 0
x = []
y = []
v1 = []
v2 = []
while(True):
f = open("%dresults.dat"%i,"r")
for line in f:
x.append(float(line.split()[0]))
y.append(float(line.split()[1]))
v1.append(float(line.split()[2]))
v2.append(float(line.split()[3]))
f.close()
hold(False)
figure(1)
quiver(x, y, v1, v2, color='b', units='width', scale=1.0)
xlabel('$x$')
ylabel('$y$')
grid(True)
print i
savefig('graph-%05d.pdf'%i)
close(1)
x = []
y = []
v1 = []
v2 = []
i = i + 1
[end]
Regards,
--Damon
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel