David,
Thanks for your email. Obviously you figured out one way to print to a
file.
I was working on generic support for gnuplot terminals and the code is
checked into CVS. If you are willing to install Gnuplot.py from CVS you
can try it out. I've defined a mechanism in termdefs.py for defining
terminal options, and I've typed the list of options for a few terminal
types into that file (including png). It would be easy for you to add
the information about other terminal types that you want to use, and
then the Gnuplot.hardcopy() method will be able to work the them.
Unfortunately the only documentation is in the source file, which is
one reason that I haven't released a version including this new code :-(
The other, main reason is that I haven't had time to work on Gnuplot.py
in quite a while. :-( :-(
You might run into the famous "temporary-file deletion" problem if you
try to use your script in an automated environment. See the archives of
this newsgroup and FAQS.txt in the CVS repository of Gnuplot.py for more
information.
Regarding the jpeg and gif support: jpeg should work (afaik) though
since it is lossy it is not ideal for output such as that produced by
gnuplot. (You will especially notice that the large white background
regions are not uniform.) PNG is the recommended output format if it
can be used by the rest of your tools. Jpeg support is compiled into
the gnuplot packaged with RedHat Linux but it is possible that you have
to recompile gnuplot to enable support for it.
I don't believe that gnuplot supports GIF anymore because GIF is a
proprietary format and to write GIF files requires paying a license fee
to somebody. But see the gnuplot web site or user groups for the latest
information on that topic.
Yours,
Michael
David Casti wrote:
>On 1/10/03 8:32 AM, "David Casti" <da...@ne...> wrote:
>
>>My question: how do I get the output of gnuplot to go into a gif, png or
>>jpeg file? I believe I have compiled and installed all of the correct
>>components to make this possible... but I just don't know where to throw the
>>switch. Can someone give me a quick pointer?
>>
>>
>
>I asked too soon... turns out this is not hard at all --
>
>import Gnuplot, Gnuplot.funcutils
>g = Gnuplot.Gnuplot( debug=1 )
>g('set term png')
>g('set output "/tmp/david.png"')
>g.plot( [ [0, 1], [1, 2], [2, 3], [3, 4] ] )
>
>
--
Michael Haggerty
mh...@al...
|