how to call a gnuplot script from perl

gnuplot, perl

Solution

You can open a pipe to gnuplot:

use autodie qw(:all);
open my $GP, '|-', 'gnuplot';

print {$GP} <<'__GNUPLOT__';
    set xrange [-5:5];
    plot sin(x);
__GNUPLOT__

close $GP;

Or, you can reach for Chart::Gnuplot on CPAN.

Problem

I have a gnu.gp file : ``` # grphist.conf set terminal canvas #Terminal type set to 'canvas' #Options are ' solid butt size 600,400 fsize 10 lw 1 fontscale 1 standalone' set output 'output.html' set grid set xtic rotate by 90 set style data histograms set style fill solid 1.00 border -1 #$ cat grphist.conf | gnuplot plot "c_time" using 2:xtic(1) title "time to number of UIDs" ``` But, I have to integrate this with a perl script.

Original source

Related problems