diff --git a/plotpipe/plotpipe b/plotpipe/plotpipe index 79556c9..2b15e46 100755 --- a/plotpipe/plotpipe +++ b/plotpipe/plotpipe @@ -9,7 +9,7 @@ plotpipe - Plot CSV data from a pipe =head1 SYNOPSIS -I | B [-n] [-H] [-0] [-C str] [-h] [-V] +I | B [-n] [-H] [-0] [--logx] [--logy] [-C str] [-h] [-V] =head1 DESCRIPTION @@ -48,6 +48,15 @@ B<--header>. Show help. +=item B<--logx> + +=item B<--logy> + +=item B<--logxy> + +Logarithmic X/Y/X&Y axis. + + =item B<--nox> =item B<-n> @@ -160,6 +169,9 @@ sub options_hash() { "version|V" => \$opt::version, "colsep|col-sep|C=s" => \$opt::colsep, "help|h" => \$opt::help, + "logx" => \$opt::logx, + "logy" => \$opt::logy, + "logxy" => \$opt::logxy, "null|0" => \$opt::null, "nox|n" => \$opt::nox, "header|H" => \$opt::header, @@ -291,7 +303,7 @@ sub find_sep(@) { Getopt::Long::Configure("bundling","require_order"); my $retval = GetOptions(options_hash()); $Global::progname = "plotpipe"; -$Global::version = 20201005; +$Global::version = 20201125; if($opt::version) { version(); exit 0; } if($opt::help) { help(); exit 0; } if($opt::null) { $/ = "\0"; } @@ -363,9 +375,19 @@ for(my $col = 2; $col <= $ncols; $col++) { push @plotscript, qq("$filename" using 1:$col with lines $legend,); } +my @logscale; +if($opt::logx or $opt::logxy) { + push @logscale, "set logscale x 10;"; +} +if($opt::logy or $opt::logxy) { + push @logscale, "set logscale y 10;"; +} + + # Make full Gnuplot script my $plotscript=<<_EOS ; set title "@title"; +@logscale set xtics rotate; set autoscale; set xlabel "$header[0]";