Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Chart::Gnuplot png format

by hmadhi (Acolyte)
on Sep 12, 2011 at 09:52 UTC ( #925437=perlquestion: print w/ replies, xml ) Need Help??
hmadhi has asked for the wisdom of the Perl Monks concerning the following question:

Weird. I am unable to create a png file using Chart::Gnuplot. All necessary is installed (ImageMagick) for the convert utility. The output is set to file.png. I have also tried $chart->convert('png') and $chart->('png'). The output file is always "PostScript document text conforming at level 2.0". I have also tried jpg and gif but always get the some output type. If I manually use the convert utility all works fine. Any ideas. Using Chart::Gnuplot 0.16.

Comment on Chart::Gnuplot png format
Re: Chart::Gnuplot png format
by ww (Bishop) on Sep 12, 2011 at 10:12 UTC
    My idea is that it would be a lot easier to help you if you posted your corde.

      Code is as follows:

      my $chart = Chart::Gnuplot->new(output =>"file.png", gnuplot => /usr/bin/gnuplot", ) $chart->plot2d($dataSet0, $dataSet1);
Re: Chart::Gnuplot png format
by keszler (Priest) on Sep 12, 2011 at 11:04 UTC

    According to Chart::Gnuplot:

    If the filename has no extension, postscipt will be used.

    Examine your $chart->output('file.png'); line; it's not working.

Re: Chart::Gnuplot png format
by roboticus (Canon) on Sep 12, 2011 at 13:52 UTC

    hmadhi:

    While you've installed ImageMagick, is Chart::Gnuplot finding ImageMagick properly? Are you checking for errors? Do any error messages involve convert?

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      Hi

      No error messages. convert is installed in /usr/bin/

Re: Chart::Gnuplot png format
by ambrus (Abbot) on Sep 12, 2011 at 14:53 UTC

    See also Re: Draw chart for a complete code example generating a PNG image output with gnuplot.

Re: Chart::Gnuplot png format
by hmadhi (Acolyte) on Sep 14, 2011 at 06:43 UTC

    I have found the "problem". I have been plotting datasets that do not contain data. eg

    $chart->plot2d($dataSet0, $dataSet1, $dataSet2;)

    where dataSet0 returns a set of null values. In the previous version of Chart::Gnuplot this was not an issue and I did not have this problem. Such datasets were ignored and the conversion takes place correct. Remember, I am getting a ps file being generated, only the convert is not working. If I do a manual convert the graph is plotted correct.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://925437]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-08-01 03:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls