use strict; use warnings; use 5.010; use IO::Handle; use File::Temp "tempfile"; my($T,$N) = tempfile("plot-XXXXXXXX", "UNLINK", 1); for my $g (1..6) { for my $s (1..4) { print $T rand(10/$s), " "; } print $T "\n"; } open my $P, "|-", "gnuplot" or die; printflush $P qq[ unset key set yrange [0:] set style data histogram set style histogram rowstacked set style fill solid 0.5 set boxwidth 0.9 plot for [COL=1:4] "$N" using COL ]; ; close $P; __END__