From: Nicola K. <Nic...@ur...> - 2005-08-18 22:32:32
|
Hi, is there any method which I haven=B4t found yet in gnuplot.py to get = what=20 would otherwise be printed on stdout? What I actually want to do is to set my terminal to png and have the=20 binary-png-code stored in a string instead of a file or piped to=20 stdout. I treid something like: p=3DGnuplot.Gnuplot(debug=3D1) p('set terminal png') oldstdout=3Dsys.stdout output=3DcStringIO.StringIO() # IO-String instanzieren sys.stdout=3Doutput # stdout nach output umleiten p.plot([[1,0],[2,50],[3,0],[4,20],[5,0],[6,30],[7,70], [8,70], [9, 75],=20= [10, 50], [11, 30], [12, 50]]) sys.stdout=3Doldstdout print output.getvalue() But unfortunatelly I also get other stuff like "gnuplot: unable to open display '' "gnuplot: X11 aborted" Can anyone help me on that? Thanks, Nicola |