in reply to Date sorting

Hi,
the first thing that comes to my mind is that recent gnuplot versions don't support the terminal "gif" anymore. Maybe you want to try changing that to e.g. png.

Update: Further Examination(tm) shows:

  1. No terminal "gif" in my gnuplot:
    $ ./datesort.pl 1e-05 1e-10 gnuplot> set terminal gif ^ "27968-gps.plt", line 1: unknown or ambiguous terminal type; +type just 'set terminal' for a list
  2. The resulting PNG image is a very good looking chart without any data plotted *grin*
  3. The datafile gpsmk4.dat is empty (that becomes visible easier, when you don't put your files into /tmp; not speaking of not deleting them at the end of your programm...)
  4. if (compare_dates([$month,$day,$hour,$min,$sec], $sdate_cursor) > 0)
    this statement is never true (your start-month is March and all data is from January...?)
    So maybe you want to check that logic...

Regards Stefan K

Replies are listed 'Best First'.
Re: Re: Date sorting
by maderman (Beadle) on Apr 12, 2001 at 14:53 UTC
    The problem was solved by closing the file GPsmk4 (see below). Leaving this filehandle open caused all my problems! Thanks for your suggestions ! Regards, Stacy.
    open(CLOCK,"$gps2_log") or die "$gps2_log not available: $!\n"; open(GPSmk4,">>/tmp/gpsmk4.dat"); while($line = <CLOCK>) { next if $line =~ /last/; ($month,$day,$time) = ( split(/\s+/,$line) )[0..2]; ($hour,$min,$sec) = split(':',$time); $month = sprintf "%02d", $months{$month}; $day = sprintf "%02d", $day; $data3 = ( split(/\s+/,$line) )[6]; last if(compare_dates([$month,$day,$hour,$min,$sec],$edate_cursor)>0); if (compare_dates([$month,$day,$hour,$min,$sec],$sdate_cursor)>0); { if( $data3 > $plotymax ) { $plotymax = $data3; } if( $data3 < $plotymin ) { $plotymin = $data3; } print GPSmk4 "$month-$day $time $data3\n"; } # update the date cursor $date_cursor = [$month,$day,$hour,$min,$sec]; +close(GPSmk4); } #end of while