Matplotlib - an odd problem
koranthala at gmail.com
Wed Jun 24 14:38:02 EDT 2009
I am using Matplotlib with Django to display charts on the web page.
I am facing an odd problem in that, everytime I do a refresh on the
web page, the image darkens - and the text becomes little unreadable.
5/6 refreshes later, the text becomes completely unreadable.
Since I am using Django test server, the same process is being used.
i.e. every refresh does not create a new process. When I tried killing
the process, the image again cleared.
So I think it is sort of memory leak or a saved value which is messing
But I cannot seem to find the issue at all.
The code is as follows -
from cStringIO import StringIO
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
data = [15,30,45, 10]
ax = pylab.axes([0.1, 0.1, 0.8, 0.8])
pylab.pie(data, explode=None, labels=labels, autopct='%1.1f%%',
out = StringIO()
response = HttpResponse()
response['Content-Type'] = 'image/png'
Can anyone help me out here?
More information about the Python-list