Plotting time series data together with some

This is a discussion on Plotting time series data together with some within the Graphics forums in Theory and Concepts category; I have time series data like this: 2006-01-07 01:00 3.100 2006-01-07 02:00 2.500 2006-01-07 03:00 2.700 2006-01-07 04:00 2.900 2006-01-07 05:00 3.000 2006-01-07 06:00 2.200 2006-01-07 07:00 2.400 2006-01-07 08:00 2.500 I am trying to plot a) the data points together with b) average and standard deviation lines, say something like: http://upload.wikimedia.org/wikipedi...lustration.gif Part a) wasn't too difficult: I read 1000's of data files and produce PNGs out of them. However, now I would need some pointers to examples of how to get to b) ? I assume there must be some helpful built-in or user-defined gnuplot functions around. Or would ...

Go Back   Application Development Forum > Theory and Concepts > Graphics

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-28-2008, 03:13 AM
Hermann Peifer
Guest
 
Default Plotting time series data together with some

I have time series data like this:

2006-01-07 01:00 3.100
2006-01-07 02:00 2.500
2006-01-07 03:00 2.700
2006-01-07 04:00 2.900
2006-01-07 05:00 3.000
2006-01-07 06:00 2.200
2006-01-07 07:00 2.400
2006-01-07 08:00 2.500

I am trying to plot a) the data points together with b) average and
standard deviation lines, say something like:
http://upload.wikimedia.org/wikipedi...lustration.gif

Part a) wasn't too difficult: I read 1000's of data files and produce
PNGs out of them. However, now I would need some pointers to examples
of how to get to b) ?

I assume there must be some helpful built-in or user-defined gnuplot
functions around. Or would it be smarter to pre-process the data (e.g.
with Awk) and provide the statistical values to gnuplot?

Thanks in advance and sorry in case this was a FAQ,

Hermann
Reply With Quote
  #2  
Old 08-28-2008, 03:15 AM
Hermann Peifer
Guest
 
Default Re: Plotting time series data together with some statistics

Subject line completed. Sorry. Hermann

On Aug 28, 9:13*am, Hermann Peifer <hpei...@gmail.com> wrote:
> I have time series data like this:
>
> 2006-01-07 * * *01:00 * 3.100
> 2006-01-07 * * *02:00 * 2.500
> 2006-01-07 * * *03:00 * 2.700
> 2006-01-07 * * *04:00 * 2.900
> 2006-01-07 * * *05:00 * 3.000
> 2006-01-07 * * *06:00 * 2.200
> 2006-01-07 * * *07:00 * 2.400
> 2006-01-07 * * *08:00 * 2.500
>
> I am trying to plot a) the data points together with b) average and
> standard deviation lines, say something like:http://upload.wikimedia.org/wikipedi...deviation_illu...
>
> Part a) wasn't too difficult: I read 1000's of data files and produce
> PNGs out of them. However, now I would need some pointers to examples
> of how to get to b) ?
>
> I assume there must be some helpful built-in or user-defined gnuplot
> functions around. Or would it be smarter to pre-process the data (e.g.
> with Awk) and provide the statistical values to gnuplot?
>
> Thanks in advance and sorry in case this was a FAQ,
>
> Hermann


Reply With Quote
  #3  
Old 08-28-2008, 05:03 PM
Hans-Bernhard Bröker
Guest
 
Default Re: Plotting time series data together with some statistics

Hermann Peifer wrote:
> Subject line completed. Sorry. Hermann


[That's what "Cancel" and "Supersede" are for. Not that Google groups
is likely to support that, mind you...]

>> I assume there must be some helpful built-in or user-defined gnuplot
>> functions around. Or would it be smarter to pre-process the data (e.g.
>> with Awk) and provide the statistical values to gnuplot?


gnuplot isn't really in the data processing business. So yes, you
should probably consider using AWK or something like that for this job.
Reply With Quote
  #4  
Old 08-29-2008, 07:28 AM
Hermann Peifer
Guest
 
Default Re: Plotting time series data together with some statistics

On Aug 28, 11:03*pm, Hans-Bernhard Bröker <HBBroe...@t-online.de>
wrote:
> gnuplot isn't really in the data processing business. *So yes, you
> should probably consider using AWK or something like that for this job.



Thanks. That's what I am doing currently. Then I make gnuplot draw
nohead arrows and rectangle objects in order to get a line for the
average and a box for standard deviation.

Do I see this right: There aren't too many gnuplot examples around
with time series data, i.e. more of these: http://gnuplot.sourceforge.net/demo_4.3/timedat.html

?

One of my current questions is: Is it somehow possible to use a column
in the data file as point type, e.g. like this:

date time value type
2006-01-07 01:00 3.100 1
2006-01-07 02:00 2.500 2
2006-01-07 03:00 2.700 3

Currently, I make AWK slice the original data file into pieces, based
on value ranges, then I let gnuplot read the temp files. I have a
vague feeling that there must be something smarter...

> Google groups...


No NNTP at work. Sorry.

Hermann
Reply With Quote
  #5  
Old 08-30-2008, 02:31 PM
Hans-Bernhard Bröker
Guest
 
Default Re: Plotting time series data together with some statistics

Hermann Peifer wrote:

> Thanks. That's what I am doing currently. Then I make gnuplot draw
> nohead arrows and rectangle objects in order to get a line for the
> average and a box for standard deviation.


That shouldn't be necessary. gnuplot does have errorbar and
boxxyerrorbars plotting style available for such purposes.

> One of my current questions is: Is it somehow possible to use a column
> in the data file as point type,


Not to my knowledge.
Reply With Quote
  #6  
Old 08-31-2008, 01:46 PM
Hermann Peifer
Guest
 
Default Re: Plotting time series data together with some statistics

Hans-Bernhard Bröker wrote:
> Hermann Peifer wrote:
>
>> Thanks. That's what I am doing currently. Then I make gnuplot draw
>> nohead arrows and rectangle objects in order to get a line for the
>> average and a box for standard deviation.

>
> That shouldn't be necessary. gnuplot does have errorbar and
> boxxyerrorbars plotting style available for such purposes.
>


I am not quite sure if errorbars can help me, as I am currently generating some PNGs like this one: http://tinyurl.com/5a2ujs (where I used nohead arrows and rectangle objects to plot average and standard deviation values).

>> One of my current questions is: Is it somehow possible to use a column
>> in the data file as point type,

>
> Not to my knowledge.


Hmm. Then I will have to continue with my temp file workaround :-(

Hermann
Reply With Quote
  #7  
Old 09-01-2008, 06:17 AM
Dan Hatton
Guest
 
Default Re: Plotting time series data together with some

On Thu, 28 Aug 2008, Hermann Peifer wrote:

> I have time series data like this:
>
> 2006-01-07 01:00 3.100
> 2006-01-07 02:00 2.500
> 2006-01-07 03:00 2.700
> 2006-01-07 04:00 2.900
> 2006-01-07 05:00 3.000
> 2006-01-07 06:00 2.200
> 2006-01-07 07:00 2.400
> 2006-01-07 08:00 2.500
>
> I am trying to plot a) the data points together with b) average and
> standard deviation lines
> Part a) wasn't too difficult: I read 1000's of data files and produce
> PNGs out of them. However, now I would need some pointers to examples
> of how to get to b) ?


You could try

set xdata time
set timefmt '%Y-%m-%d %H:%M'

m = 2.5 # Any old value should do here

mean(x) = m

fit mean(x) 'time.dat' using 1$3)1.0) via m

stddev(x) = FIT_STDFIT # Standard deviation of how much mean(x) misses col 3

plot mean(x)-stddev(x), mean(x), mean(x)+stddev(x), 'time.dat' using 1$3)

--

HTH,

Dan

<http://www.bib.hatton.btinternet.co.uk/dan/>
Reply With Quote
  #8  
Old 09-01-2008, 10:58 AM
Hermann Peifer
Guest
 
Default Re: Plotting time series data together with some

On Sep 1, 12:17*pm, Dan Hatton <vi5u0-gnup...@yahoo.co.uk> wrote:
> On Thu, 28 Aug 2008, Hermann Peifer wrote:
> > I have time series data like this:

>
> > 2006-01-07 01:00 * 3.100
> > 2006-01-07 02:00 * 2.500
> > 2006-01-07 03:00 * 2.700
> > 2006-01-07 04:00 * 2.900
> > 2006-01-07 05:00 * 3.000
> > 2006-01-07 06:00 * 2.200
> > 2006-01-07 07:00 * 2.400
> > 2006-01-07 08:00 * 2.500

>
> > I am trying to plot a) the data points together with b) average and
> > standard deviation lines
> > Part a) wasn't too difficult: I read 1000's of data files and produce
> > PNGs out of them. However, now I would need some pointers to examples
> > of how to get to b) ?

>
> You could try
>
> set xdata time
> set timefmt '%Y-%m-%d %H:%M'
>
> m = 2.5 # Any old value should do here
>
> mean(x) = m
>
> fit mean(x) 'time.dat' using 1$3)1.0) via m
>
> stddev(x) = FIT_STDFIT # Standard deviation of how much mean(x) misses col 3
>
> plot mean(x)-stddev(x), mean(x), mean(x)+stddev(x), 'time.dat' using 1$3)
>


Looks fine. I will try to learn more about the fit...using...via sytax
which seems to be helpful.

Thanks, Hermann
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 09:55 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.