[Graph-dev] Problem w/generating PNGs

Jay Stanley jay.stanley at lightsurf.com
Wed Aug 6 13:35:50 PDT 2003


I installed the current Chart::Graph::Gnuplot from CPAN (v1.7 1999/04/23),
and no matter how I call it (ie output type => 'png', output type => 'pbm',
output type=>'jpeg'), it tries to run some program called pbmtogif, even
though I'm not requesting GIF output.  I copied the demo program from the
documentation with minor modifications -- here's the program:

#!/usr/bin/perl -wT
$| = 1;

use Chart::Graph::Gnuplot qw(gnuplot);

  print "Content-Type: image/pbm \n\n";

  gnuplot({"title" => "foo",
           "x2-axis label" => "bar",
           "logscale x2" => "1",
           "logscale y" => "1",
           "output type" => "pbm",
           "output file" => "-",
           "terminal"    => "pbm",
           "xtics" => [ ["small\\nfoo", 10], ["medium\\nfoo", 20],
["large\\nfoo", 30] ],
           "ytics" => [10,20,30,40,50]},
           "xdata" => "time",
           "format" => ["x", "%m/%d"],
#           "timefmt"=> $date_format,
           "extra_opts" => "set key left top Left",
          [{"title" => "data1",
            "type" => "matrix"}, [[1, 10],
                                  [2, 20],
                                  [3, 30]] ],
);


The problem seems to occur in lines 200-208, where it checks to see if the
type you specified is either pbm or gif, and exits if it's not either.  I'd
prefer to use png's or jpegs, as pbm's aren't supported by most browsers.

Are there plans to make this work for png's, or jpeg's,or anything other
than GIFs?  I used to use a package called Chart::Gnuplot which worked fine,
but apparently isn't available any more.

-jay



More information about the Graph-dev mailing list