I have a trouble when displat a PNG file which generated from matplotlib
here is the script from http://www.scipy.org/Cookbook/Matplotlib/Using_MatPlotLib_in_a_CGI_script
there is no image in the web browser, is there anything wrog with the script?
please help me, I am a newbie in matplotlib
–
#!/usr/bin/python
import pylab
import matplotlib
import os,sys
import cgi
import cgitb
cgitb.enable()
os.environ[‘HOME’]=’/tmp/’
matplotlib.use(‘Agg’)
form = cgi.FieldStorage()
pylab.plot([1,2,3])
print “Content-Type: image/png\n”
pylab.savefig(sys.stdout,format=‘png’)
–
and then here is my computer specification
CentOS 5.1 – Linux localhost.localdomain 2.6.18-53.el5 #1 SMP Mon Nov 12 02:22:48 EST 2007 i686 i686 i386 GNU/Linux
python-2.4.3-19.el5
numpy-1.0.3.1-1.el5.kb
scipy-0.6.0-6.el5
matplotlib 0.91.4
···
–
Zainal Abidin, S.Si
Sub Bidang Informasi Meteorologi Publik
Badan Meteorologi dan Geofisika
Jl. Angkasa I No. 2
Jakarta - Indonesia
Visit Indonesia Year 2008 - Celebrating 100 Years of National Awakening