|
From: JamieRGraves <chi...@gm...> - 2007-12-04 13:36:40
|
Hello, I have a the following problem, and haven't managed to find an answer to it yet. I have a number of data files, which look something like: datFile1: 14:58:37.5807098 20.28985 14:58:38.6623082 15.71429 14:58:39.7639362 20 datFile2: 15:16:41.0575811 4.285715 15:16:42.1391903 24.63768 15:16:43.2207995 14.49275 These are two representative examples of about 8 data files I need to plot. I'm interested in only using the first column from datFile1 as the X axis data. The Y axis data will then be taken from column 2 from all of the files. How would I go about telling gnuplot to use only this first column in the first file as the X axis data? Is it a case of assigning the use of the first column from datFile1 as a variable? Thanks in advance for your help in this matter. - Jamie -- View this message in context: http://www.nabble.com/Using-Single-Data-column-as-X-axis-Data-tf4943162.html#a14150809 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2007-12-04 14:50:08
|
if you want to compare the y-data without caring for the exact time values (works if the x values are equidistant): plot 'datFile1' using 0:2, 'datFile2' using 0:2 if you care for the exact time values in 'datFile1', then subtract the time shift of each file in respect to 'datFile1' (in seconds): set xdata time set timefmt "%H:%M:%S" plot 'datFile1' using 1:2, 'datFile2' using (timecolumn(1)-1084.):2 and, use at least gnuplot 4.2 JamieRGraves wrote: > > Hello, > > I have a the following problem, and haven't managed to find an answer to > it yet. I have a number of data files, which look something like: > > datFile1: > > 14:58:37.5807098 20.28985 > 14:58:38.6623082 15.71429 > 14:58:39.7639362 20 > > datFile2: > > 15:16:41.0575811 4.285715 > 15:16:42.1391903 24.63768 > 15:16:43.2207995 14.49275 > > These are two representative examples of about 8 data files I need to > plot. I'm interested in only using the first column from datFile1 as the X > axis data. The Y axis data will then be taken from column 2 from all of > the files. > > How would I go about telling gnuplot to use only this first column in the > first file as the X axis data? Is it a case of assigning the use of the > first column from datFile1 as a variable? > > Thanks in advance for your help in this matter. > > - Jamie > -- View this message in context: http://www.nabble.com/Using-Single-Data-column-as-X-axis-Data-tf4943162.html#a14151758 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: JamieRGraves <chi...@gm...> - 2007-12-04 16:01:00
|
Thanks, that makes sense, and works like a charm. Another quick question - how would I go about plotting the average of the values returned in column 2 from the dat file? Can this be achieved with gnuplot, or should I calculate this within software? Thomas Sefzick wrote: > > if you want to compare the y-data without caring for the exact time values > (works if the x values are equidistant): > > plot 'datFile1' using 0:2, 'datFile2' using 0:2 > > if you care for the exact time values in 'datFile1', then subtract the > time shift of each file in respect to 'datFile1' (in seconds): > > set xdata time > set timefmt "%H:%M:%S" > plot 'datFile1' using 1:2, 'datFile2' using (timecolumn(1)-1084.):2 > > and, use at least gnuplot 4.2 > > > JamieRGraves wrote: >> >> Hello, >> >> I have a the following problem, and haven't managed to find an answer to >> it yet. I have a number of data files, which look something like: >> >> datFile1: >> >> 14:58:37.5807098 20.28985 >> 14:58:38.6623082 15.71429 >> 14:58:39.7639362 20 >> >> datFile2: >> >> 15:16:41.0575811 4.285715 >> 15:16:42.1391903 24.63768 >> 15:16:43.2207995 14.49275 >> >> These are two representative examples of about 8 data files I need to >> plot. I'm interested in only using the first column from datFile1 as the >> X axis data. The Y axis data will then be taken from column 2 from all of >> the files. >> >> How would I go about telling gnuplot to use only this first column in the >> first file as the X axis data? Is it a case of assigning the use of the >> first column from datFile1 as a variable? >> >> Thanks in advance for your help in this matter. >> >> - Jamie >> > > -- View this message in context: http://www.nabble.com/Using-Single-Data-column-as-X-axis-Data-tf4943162.html#a14153452 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2007-12-04 16:40:05
|
JamieRGraves wrote: > > Another quick question - how would I go about plotting the average of the > values returned in column 2 from the dat file? Can this be achieved with > gnuplot, or should I calculate this within software? > if you need the average of all y-values of one datafile (or the average of all y-values of all datafiles), then have a look at http://gnuplot.sourceforge.net/demo_4.3/data_feedback.html if you need the average of the y-values from several datafiles for each specific x-value, then - i think - it's easier to calculate these averages outside gnuplot. -- View this message in context: http://www.nabble.com/Using-Single-Data-column-as-X-axis-Data-tf4943162.html#a14154071 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: JamieRGraves <chi...@gm...> - 2007-12-04 16:52:24
|
Many thanks. I'll calculate it outside of gnuplot. Thomas Sefzick wrote: > > > JamieRGraves wrote: >> >> Another quick question - how would I go about plotting the average of the >> values returned in column 2 from the dat file? Can this be achieved with >> gnuplot, or should I calculate this within software? >> > > if you need the average of all y-values of one datafile (or the average of > all y-values of all datafiles), then have a look at > http://gnuplot.sourceforge.net/demo_4.3/data_feedback.html > > if you need the average of the y-values from several datafiles for each > specific x-value, then - i think - it's easier to calculate these averages > outside gnuplot. > > -- View this message in context: http://www.nabble.com/Using-Single-Data-column-as-X-axis-Data-tf4943162.html#a14154523 Sent from the Gnuplot - User mailing list archive at Nabble.com. |