Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2844 > unrolled thread
| Started by | s0198362 <adrian.h.hill@gmail.com> |
|---|---|
| First post | 2015-03-26 11:47 -0700 |
| Last post | 2015-03-27 11:23 -0700 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
importing list off files s0198362 <adrian.h.hill@gmail.com> - 2015-03-26 11:47 -0700
Re: importing list off files Karl <mail.kfr@gmx.net> - 2015-03-27 11:24 +0100
Re: importing list off files s0198362 <adrian.h.hill@gmail.com> - 2015-03-27 11:23 -0700
| From | s0198362 <adrian.h.hill@gmail.com> |
|---|---|
| Date | 2015-03-26 11:47 -0700 |
| Subject | importing list off files |
| Message-ID | <4ebd80ff-61a2-473c-bead-88a239bdf362@googlegroups.com> |
Hi there. I have a couple of questions that I can't work out how to solve. (I think I have got somewhere in this forum, but am still a little stuck.
Any help appreciated (using wgnuplot_pipes v. 4.6 in Windows 7)
1. I am trying to plot a series of files that would be updated either daily or weekly. The file name is e.g. 15-03-26.xy 15-03-27.xy etc.
The file format of the 8.xy is:
34.80000 647.000
34.80143 656.000
34.80285 712.000
34.80428 701.000
34.80570 669.000
34.80713 658.000
34.80855 627.000
34.80998 675.000
I have the following in my script, but can't seem to get it to work
LIST = system("ls -1 *.xy")
FILES = words(LIST)
FILE(i) = word(LIST,i)
plot for [i=1:FILES:1] FILE(i)
How do I plot (or even print the list) the various files I have?
2. Obviously the files are named by the date they were created. Can I extract that date and use it as a x axis in a second plot against the maximum value in that file?
The following gets the maximum value out of the last graph to be plotted. Any way to get the date?
stats '' u 2 name 'latest'
print filename
set print 'test.txt' append
print latest_max
Many thanks
Adrian
[toc] | [next] | [standalone]
| From | Karl <mail.kfr@gmx.net> |
|---|---|
| Date | 2015-03-27 11:24 +0100 |
| Message-ID | <mf3b4r$4l9$1@news.rz.uni-karlsruhe.de> |
| In reply to | #2844 |
Am 26.03.2015 um 19:47 schrieb s0198362:
> Hi there. I have a couple of questions that I can't work out how to
> solve. (I think I have got somewhere in this forum, but am still a
> little stuck.
>
> Any help appreciated (using wgnuplot_pipes v. 4.6 in Windows 7)
...
> I have the following in my script, but can't seem to get it to work
>
> LIST = system("ls -1 *.xy") FILES = words(LIST) FILE(i) =
> word(LIST,i)
>
> plot for [i=1:FILES:1] FILE(i)
You said you're on windows, not unix. The command you want is "dir /B".
You can simply "print LIST" the list of file names to check its content,
it's just a string variable.
> 2. Obviously the files are named by the date they were created. Can
> I extract that date and use it as a x axis in a second plot against
> the maximum value in that file?
>
> The following gets the maximum value out of the last graph to be
> plotted. Any way to get the date?
You can copy the date string from the filename using substr(), and then
use strptime() to convert it to seconds.
Karl
[toc] | [prev] | [next] | [standalone]
| From | s0198362 <adrian.h.hill@gmail.com> |
|---|---|
| Date | 2015-03-27 11:23 -0700 |
| Message-ID | <e220c090-7faf-4172-91f9-7c7fadddf23c@googlegroups.com> |
| In reply to | #2844 |
Thank-you Karl. I think I have it working to do what I want.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web