Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

formating xtics for time series

992 views
Skip to first unread message

MarcinB

unread,
Mar 15, 2009, 3:11:39 PM3/15/09
to
Hello, I have problem with formating xtics, I need xtics for, let say
every 30 minutes.

Part of my date file:
17:33:57 50.1875
17:34:01 50.1875
17:34:05 50.3125
17:34:10 50.3125

My gnuplot script:

set term png size 2000, 400
set xdata time
set timefmt "%H:%M:%S"
set format x "%H:%M:%S"
set grid
set xlabel "czas"
set ylabel "temperatura"
set title "Pomiar z dnia 2009.03.14"
set yrange [36:62]
set ytics 2
set xrange ["17:30:00":"24:00:00"]
set xtics "17:30:00", "00:30:00", "24:00:00"
set output "2009.03.14.png"
plot "2009.03.14.txt" using 1:2 with points lt 1 pt 6 ps 1 notitle

Part of resulting image: http://img150.imageshack.us/my.php?image=tempb.png

Without these lines:

set xrange ["17:30:00":"24:00:00"]
set xtics "17:30:00", "00:30:00", "24:00:00"

script generates almost the same image ( no strange mtics)

I am newbie with gnuplot, please help me, btw I did not find
any helpful solution via google.

Thanks in advance

MarcinB

geep

unread,
Mar 17, 2009, 1:32:28 PM3/17/09
to
On Sun, 15 Mar 2009 12:11:39 -0700, MarcinB wrote:

> Hello, I have problem with formating xtics, I need xtics for, let say
> every 30 minutes.
>
> Part of my date file:
> 17:33:57 50.1875
> 17:34:01 50.1875
> 17:34:05 50.3125
> 17:34:10 50.3125
>
> My gnuplot script:
>
> set term png size 2000, 400
> set xdata time
> set timefmt "%H:%M:%S"
> set format x "%H:%M:%S"
> set grid
> set xlabel "czas"
> set ylabel "temperatura"
> set title "Pomiar z dnia 2009.03.14"
> set yrange [36:62]
> set ytics 2
> set xrange ["17:30:00":"24:00:00"]
> set xtics "17:30:00", "00:30:00", "24:00:00" set output "2009.03.14.png"

unset mxtics


> plot "2009.03.14.txt" using 1:2 with points lt 1 pt 6 ps 1 notitle
>
> Part of resulting image:
> http://img150.imageshack.us/my.php?image=tempb.png
>
> Without these lines:
>
> set xrange ["17:30:00":"24:00:00"]
> set xtics "17:30:00", "00:30:00", "24:00:00"
>
> script generates almost the same image ( no strange mtics)
>
> I am newbie with gnuplot, please help me, btw I did not find any helpful
> solution via google.
>
> Thanks in advance
>
> MarcinB

Hi,

1/ Add
unset mxtics
like I already did above in your example.
This suppresses the default minor tics.
Then you will have the major tics only every 30 minutes, which is what
you wanted.

I looked at your example image - it is a bit strange.
It shows 2 minor ticks between each major tic, and only just following
the major tic, and then a gap.
By default I would expect to see 4 minor tics equally spaced between
each major tic.
Maybe you need to upgrade your gnuplot?

2/ If you didn't already read it, I recommend the gnuplot manuals from
here: http://www.gnuplot.info/documentation.html

Cheers,
Peter

MarcinB

unread,
Mar 17, 2009, 4:14:35 PM3/17/09
to
Hi geep,

I changed my script:
unset mxtics
...
set xtics "17:30:00", "00:30:00", "24:00:00" font "arial,20" offset
0,-2
...

I got rid of strange minor tics but it did not solve the main problem:

http://img528.imageshack.us/my.php?image=temp2.png

BTW gnuplot 4.2 patchlevel 3

Thanks again

MarcinB

MarcinB

unread,
Mar 17, 2009, 4:37:41 PM3/17/09
to
Ok, I found in Gnuplot 4.2.4 announce:
...
* FIX Do not re-quantize time tics interval explicitly set by user
...

Maybe it is connected to my problem.

MarcinB

MarcinB

unread,
Mar 18, 2009, 10:46:48 AM3/18/09
to
I have just compiled gnuplot 4.2.4 and now my script works flawless.

topic closed

MarcinB

geep

unread,
Mar 18, 2009, 11:16:47 AM3/18/09
to

Hi,
I usually use 4.3, which is not yet officially released; but also have
4.2 patchlevel 3.
I compared the results betwen the very latest 4.3 from cvs - 18 March
2009, and 4.2 patchlevel 3.

They are different! Perhaps a bug in 4.2 which is fixed in 4.3.
I think that my results with 4.3 are what you want.
Take a look here: http://tinyurl.com/cvj6d9

Can you try with gnuplot 4.3?

Cheers,

Peter

0 new messages