Hello:
I'm using Gnuplot for MS-Windows 32 bit, Version 3.5 (pre 3.6),
patchlevel 325, and I'm having some difficulty controlling axis tics
an labels with time formats. I'm plotting series of about 100 daily
values and am labelling the X axis according to the format "%m-%d".
Without setting other parameters, Gnuplot automatically chooses to put
tics at weekly intervals, which is OK, and labels (like 03-14) at
every other tic, which is too crowded in this example. How do I set
tic intervals such that labels appear at, say, 4 week intervals? Or
monthly intervals?
When I use the set xtics command with values like 4 or 04-01 Gnuplot
thinks for a while and then hangs. Can someone furnish examples of
"set xtics" commands with different time formats?
Thanks,
Tim
In order to specify time/date information in a "set xtics" list, you
must write the label as you want to see it and write the position in
the format specified by "set timefmt". So if your data looks like
970429 1
970430 2
then to write a tic label in the format you want ("%m-%d"), you must
set timefmt "%y%m%d"
set xtics ("04-29" "970429")
What would be nicer would be to simply list the positions and have gnuplot
create default labels according to the 'set format' string. Unfortunately
this is broken in v325.
It has, however, been fixed in v328 (the latest release, I believe). With
this you can get the results you want with
set timefmt "%y%m%d"
set format "%m-%d"
set xtics ("970429")
To use 'set xtics' in its other modes -- which is how you'd get weekly or
monthly intervals -- I think you'll have to put in the integer equivalent
of the date/time, which is seconds from some zero point in the past. But
I (blush) forget just how this is computed. David Denholm, can you help??
Dick Crawford, aka rccra...@lanl.gov
>In message-Id: <334183a6...@204.127.4.20>
>Tim Heizenrader <heize...@worldnet.att.net> wrote:
>
>> I'm using Gnuplot for MS-Windows 32 bit, Version 3.5 (pre 3.6),
>> patchlevel 325, and I'm having some difficulty controlling axis tics
>> an labels with time formats.... . Can someone furnish examples of
>> "set xtics" commands with different time formats?
>
>
>In order to specify time/date information in a "set xtics" list, you
>must write the label as you want to see it and write the position in
>the format specified by "set timefmt". So if your data looks like
>
> 970429 1
> 970430 2
>
>then to write a tic label in the format you want ("%m-%d"), you must
>
> set timefmt "%y%m%d"
> set xtics ("04-29" "970429")
>
...
>
>It has, however, been fixed in v328 (the latest release, I believe). With
>this you can get the results you want with
>
> set timefmt "%y%m%d"
> set format "%m-%d"
> set xtics ("970429")
>
>
>To use 'set xtics' in its other modes -- which is how you'd get weekly or
>monthly intervals -- I think you'll have to put in the integer equivalent
>of the date/time, which is seconds from some zero point in the past. But
>I (blush) forget just how this is computed. David Denholm, can you help??
Thanks. I downloaded 328 and the working 'set xtics
("timefmt-format-value")' feature solved my problem. Regarding
interval scaling, it appears that you're right about the 'seconds'
resolution. I haven't fully sorted this out yet, but if you input
set xtics 1
and then input
show xtics
you are informed that you have set an interval of 1 second.
Thanks again.
Tim Heizenrader