savefig fails under apache on solaris


I am trying to use matplotlib to generate png image plots to display in web pages using apache on solaris. The problem is that savefig(sys.stdout) fails to generate any output or any error messages. The scripts run ok when run by hand, either by me or by the apache user. They also work when used as cgi scripts on a debian linux system. I am at a bit of a loss as to how to investigate what could be going wrong so any pointers would be helpful.

The matplotlib version is 0.98.0 and I am using the Agg backend.

John Bovey