|
From: Thomas S. <t.s...@fz...> - 2011-01-06 10:29:27
|
in gnuplot version >= 4.4 you could use the following plot command:
plot 'datafilename' using
1:(s=stringcolumn(2),n=strstrt(s,":"),s[1:n-1]+s[n+1:]/60.) with linespoints
david-825 wrote:
>
> currently gnuplot only supports time on the X axis, what you would need to
> do is to manipulate the data before gnuplot tries to use it.
>
> you could do soemthing like the following perl snippet
>
> #!/usr/bin/perl
> while(<>){
> chomp;
> ($first,$second) = split(":",$_);
> print $first,".",($second/60),"\n";
> }
>
> this will reformat the lines you listed to something like
>
> 2010-12-07 8.00
>
> so that instead of integer hours it will read decimal hours.
>
> If your Y axis ticks are on the hour, the graph will look the same. If you
> want tick marks in between, you would need to do something like setting
> the tick label for 7.5 to be "7:30"
>
> David Lang
>
> On Wed, 5 Jan 2011, steffen wrote:
>
>> Date: Wed, 5 Jan 2011 10:07:50 +0000 (UTC)
>> From: steffen <kla...@on...>
>> To: gnu...@li...
>> Subject: [Gnuplot-info] Need help: Time/date format
>>
>> Hi,
>> I'm going to generate a plot of sunrise time versus date.
>> The data file looks like
>>
>> 2010-12-02 7:53
>> 2010-12-03 7:55
>> 2010-12-06 7:59
>> 2010-12-07 8:00
>> ...
>>
>> So, in the first column is the date (shall be x-axis), in the second the
>> time
>> (y-axis). To read the date correctly I did:
>>
>> set xdata time
>> set timefmt "%Y-%m-%d"
>>
>> But the time (y-axis) is not read correctly, just integer hours. How to
>> set up
>> the format (time) for the y-axis?
>>
>> Thanks for help.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Learn how Oracle Real Application Clusters (RAC) One Node allows
>> customers
>> to consolidate database storage, standardize their database environment,
>> and,
>> should the need arise, upgrade to a full multi-node Oracle RAC database
>> without downtime or disruption
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> gnuplot-info mailing list
>> gnu...@li...
>> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gnuplot-info mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://old.nabble.com/Need-help%3A-Time-date-format-tp30599656p30603976.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|