in reply to Chart::Graph::Gnuplot Array Issue

You can do it without necessarily bothering with that module. Abigail-II told me how he does it, so here's a snippet I wrote.

# {{{ ->create graph method # sub create_graph { my $class = shift; open my $plot => "| /usr/local/bin/gnuplot" or die "Failed to open pipe: $!\n"; my $outfile = "/tmp/graph.png"; print $plot <<" --"; set terminal png color set out "$outfile" set format x "/%b%y/" set xdata time set key left top Left reverse samplen 2 title "Legend" box set timefmt "%s:" set grid xtics ytics set xtics nomirror set ytics nomirror set y3tics nomirror set autoscale set ylabel "ResponseTime" plot "$_[0]" using 1:2 smooth unique axis x1y1 title "Time in +ms" -- #set timefmt "%Y-%m-%d:" close $plot or die "Failed to close pipe: $!\n"; chmod 0644 => $outfile or die "Failed to chmod $outfile: $!\n" +; } # }}}
I just pass it a filename (which I had previously created with File::Temp). My::Class->create_graph( $filename );

--
"A long habit of not thinking a thing wrong, gives it a superficial appearance of being right." -- Thomas Paine
naChoZ

Replies are listed 'Best First'.
Re^2: Chart::Graph::Gnuplot Array Issue
by vbrtrmn (Pilgrim) on Jul 21, 2004 at 23:41 UTC
    DUDE, YOU ROCK! Thanks a lot!

    --
    paul