Sorry your right!!
Exacty nothing happens:
diffredential@fredlab:~/Desktop$ perl myscript.pl
diffredential@fredlab:~/Desktop$
!! | [reply] [Watch: Dir/Any] [d/l] |
...
$chart->output('mychart.png');
| [reply] [Watch: Dir/Any] [d/l] [select] |
I tried version 0.05, and the new(output => $out_file) works just fine, and produces the desired output file.
| [reply] [Watch: Dir/Any] [d/l] |
... and ls doesn't show a expression.png file? (The desktop view might not be updated immediately, so use ls to check).
I tried your script (with a different path, of course), and it worked, and with a wrong output path (ie non-existing path) an error message is shown.
If you are sure that the file is not created, you might try to run your script with strace to find out if a system call failed:
strace -f perl myscript.pl
(Update: If you don't know how to read the output from strace, post the last 30 to 50 lines here (in <readmore><code>...</code></readmore> tags), maybe somebody can enlighten you). | [reply] [Watch: Dir/Any] [d/l] [select] |
Please check the following:
- Type gnuplot --version to check whether gnuplot can be executed.
- Check whether the directory /tmp is already full.
- Check whether you have write permission of /tmp.
If they are all fine, then you should be able to use at least the basic features of Chart::Gnuplot. Please re-try your original script with expression.ps as output instead (ps format is more basic than png for the module).
You don't need the method ->output($filename) although there is no harm to do so. The output method is useful only in cases where you don't know the output filename yet when you create the chart object.
If you got expression.ps, then it may be the problem of ImageMagick. Please check whether it is installed.
If you don't want to install ImageMagick and if you want to generate png file. You may try:
my $chart = Chart::Gnuplot->new(
output => "/home/diffredential/Desktop/expression.png",
terminal => "png"
);
| [reply] [Watch: Dir/Any] [d/l] [select] |