matplotlib and zope problem

I have problem with generate charts with matplotlib under zope. I use the code based on
Problem appears when the server is overloaded (even a little oveloaded) and generally after starting zope. The image charts sometimes don't draw completely, sometimes part of first chart draw on the second image.
Web client generates two http requests. The requests are served by external functions, functions use matplotlib. Results of functions are returning two image in png format. Images are sending to client who shows it in a web browser.
First case:
Return image sometimes isn't completely. Image have labels, axises but havent't chart.
Second case:
First return image isn't completely. The part which hasn't draw on the fisrt image is drawing on the second image.

This looks like something is not synchronized or doesn't correctly use resources. Why return external function image when the process isn't completely. Why can function draw on locally buffer allocated in another function?
How resolve the problem?

I searched event.log in zope and nothing had been saved.

Zope 2.9.5, python 2.4.3, matplotlib 0.87.7, numpy-1.0.1, Plone 2.5, Debian (i686, 2 processors).