| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| 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 |
|
#3
| |||
| |||
| 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. |
|
#4
| |||
| |||
| 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 |
|
#5
| |||
| |||
| 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. |
|
#6
| |||
| |||
| 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 |
|
#7
| |||
| |||
| 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 mstddev(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/> |
|
#8
| |||
| |||
| 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 |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.