From 464d8c4233aca642cfc2be05f6f29cec4b651964 Mon Sep 17 00:00:00 2001 From: hjp Date: Sat, 30 Sep 2006 10:28:19 +0000 Subject: [PATCH] Added --style. Use Pod::Usage. Improved doc. --- tsplotv | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/tsplotv b/tsplotv index 8964212..ed95197 100755 --- a/tsplotv +++ b/tsplotv @@ -4,24 +4,53 @@ tsplotv - plot time series given in vertical format +=head1 SYNOPSIS + +tsplotv +[--legend-position pos] +[--output-format format ] +[--stacked] +[--style style] +[file ...] + =head1 DESCRIPTION This program expects time series data in vertical format, I.e., each line contains a tripel . +The default legend position is "top right", same as with gnuplot. +Another frequently useful position (especially if you have lots of series) +is "below. Note that positions which consist of several world (such as +"top right" need to be passed to tsplotv as a single argument, so the +space needs to be hidden from the shell by use of quotes or a backslash. + +The default output format is "png", the default style is "lines". + +See L for a description of possible legend positions, +output formats, and styles. + +The --stacked option causes the time series to be stacked on top of each +other. + =cut use strict; use TimeSeries; use Getopt::Long; +use Pod::Usage; +my $help; +my $legend_position = 'top right'; my $output_format ='png'; my $stacked = 0; -my $legend_position = 'top right'; -GetOptions('output_format|output-format=s' => \$output_format, - 'stacked' => \$stacked, +my $style = "lines"; +GetOptions('help|?' => \$help, 'legend_position|legend-position=s' => \$legend_position, -) or die "Usage: $0 [--output_format format] [files...]\n"; + 'output_format|output-format=s' => \$output_format, + 'stacked' => \$stacked, + 'style:s' => \$style, + ) or pod2usage(2); +pod2usage(1) if $help; binmode STDOUT, ':raw'; @@ -41,6 +70,8 @@ my @series = sort { $series{$a} <=> $series{$b} } keys %series; $ts->legend(@series); $ts->legend_position($legend_position); $ts->stacked($stacked); +$ts->style($style); + for my $timestamp (sort keys %data) { my %d = %{$data{$timestamp}}; my @values = @d{@series};