Runtime Error from savefig( )

Good afternoon group,

I am developing an application that had always before plotted a variable 2D numpy array of floats using contourf(), and then saved the figure produced as .png. Certain runs of the application (the ones with best precision) result in a failure while saving the figure using savefig(), and as consequence the message says at the end: "Runtime Error: Failure to gain raw access to bitmap data", here is the complete complaint, does someone know what is happening please?
I use windows machines and Python 2.5.4.

Traceback (most recent call last):

File "C:/OSGeo4W/apps/Python25/Scripts/Jan_7_2010/SOMangelCalculationClassesOption2NoComparison.py" , line 667 in CalculateCG:
      savefig(fname, dpi=600, facecolor='w', edgecolor='w', orientation='portrait', papertype=None, format=None, transparent=False)

File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/pyplot.py", line 269, in savefig

      return fig.savefig(*args, **kwargs)

File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/figure.py", line 782, in savefig

      self.canvas.print_figure(*args, **kwargs)

File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backends/backend_wxagg.py", line 101, in print_figure

      FigureCanvasAgg.print_figure(self, filename, *args, **kwargs)

File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backend_bases.py", line 1195, in print_figure

      **kwargs)

File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backends/backend_agg.py"), line 396, in print_png

      self.draw()

File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backends/backend_wxagg.py", line 63, in draw

      self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)

File "C:/OSGeo4W/apps/Python25/Lib/site-packages/matplotlib/backends/backend_wxagg.py", line 226, in _py_WX28_convert_agg_to_wx_bitmap

      agg.buffer_rgba(0,0))

File "C:/OSGeo4W/apps/Python25/Lib/site-packages/wx-2.8-msw-unicode\wx\_gdi.py", line 889, in BitmapFromBufferRGBA

      return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)

      RuntimeError: Failed to gain raw access to bitmap data.

M. Angelica Echavarria-Gregory, M.Sc., E.I.
Ph.D Candidate
University of Miami
Phone 305 284-3611