Subject: | xrange not working if x set as time-axis |
xrange not working if x set as time-axis.
Broke my head and figured that the commands
set xdata time
set timefmt "%Y-%m-%d %H:%M:%S"
must be executed BEFORE
set xrange ['2008-08-01 10:00:00':'2008-09-01 14:00:00']
command is executed (in the /tmp/blahblah/plot file)
Attaching my fix too..
Subject: | Chart_Gnuplot.xrange.diff |
318a319,334
> # For xrange to work for time-sequence, time-axis ("set xdata time")
> # and timeformat ("set timefmt '%Y-%m-%d %H:%M:%S'") MUST be set BEFORE
> # the range command ("set xrange ['2009-01-01 09:00:00','2009-01-07 15:00:00']")
> if (defined $self->{timeaxis})
> {
> my @axis = split(/,\s?/, $self->{timeaxis});
> foreach my $axis (@axis)
> {
> print PLT "set $axis"."data time\n";
> push(@sets, $axis."data");
> }
> }
> if (defined $self->{timefmt})
> {
> print PLT "set timefmt $self->{timefmt}\n";
> }
395,403d410
< elsif ($attr eq 'timeaxis')
< {
< my @axis = split(/,\s?/, $self->{timeaxis});
< foreach my $axis (@axis)
< {
< print PLT "set $axis"."data time\n";
< push(@sets, $axis."data");
< }
< }
408c415
< elsif ($attr !~ /^(gnuplot|imagesize|orient|bg|plotbg)$/ &&
---
> elsif ($attr !~ /^(gnuplot|imagesize|orient|bg|plotbg|timeaxis|timefmt)$/ &&