Quantcast

'plot for' syntax

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

'plot for' syntax

Yanni
Hello everyone

Can someone please help me with 'plot for'? I have 10 files I would like
to plot.
My files are in this format:

HeliumFoil_23434_2346673_642345-43.vec
............
............
............
HeliumFoil_23434_2346640_642340-40.vec

I looked at the 'help info' and online and found out about the "plot
for" syntax. I'm trying to plot all the files at once without having to
do each one of them individually but I'm struggling to define x in the
'plot for' command below:

plot for [x=1:10] '*.vec' using 1:2 title 'Flow'.x

When I run the above, it complains about not being able to find '.vec'
file. I think I have to define
x inside the '*.vec' but I don't know how.

Many thanks for your support
goud

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'plot for' syntax

ivana richterova
Hi Goud,

> plot for [x=1:10] '*.vec' using 1:2 title 'Flow'.x

this is not how it works.

I guess you this solution:
#unix,linux
> files_to_plot=system("ls *.vec")
#windows
> files_to_plot=system("dir /b *.vec")
#then
> plot for [ no = 1 : words(files_to_plot) ] word(files_to_plot, no) using 1:2 title 'Flow'.no

Sincerely

Iva

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 'plot for' syntax

Yanni
Hi Ivana

Many thanks for your reply. The result is all squeezed. This is my
little script:

------------------------------------------------------------------------------

set term pdf
set output 'test.pdf'
set size square
set xrange [1:4000]
set yrange [1:4000]
set palette defined (0 "black", 1 "red", 2 "orange", 3 "green", 4 "blue")

files= system ("ls *.vec")
#files= "file.vec"

pointsize = 1.5

#plot for [ no = 1 : words(files) ] word(files, no) using 1:2 title
'Flow'.no
#plot files u 2:3:1 w l lc palette

plot for [ no = 1 : words(files) ] word(files, no) using 1:2 title
'Flow'.no u 2:3:1 w l lc palette

------------------------------------------------------------------------------

Before I found out about "plot for". I was plotting each file
individually using:

plot files u 2:3:1 w l lc palette

If I try to add these parameters: (u 2:3:1 w l lc pallette) into the
"plot for" syntax, in oder to get a better looking graph, gnuplot is not
happy and gives me this error:

"gnuplotloop.script", line 15: unexpected or unrecognized token

Line 15 is the "plot for" line. Could you please let me know how can I
add these parametes in the "plot for" syntax?

Thank you



On 13/02/17 10:42, ivana richterova wrote:

> Hi Goud,
>
>> plot for [x=1:10] '*.vec' using 1:2 title 'Flow'.x
> this is not how it works.
>
> I guess you this solution:
> #unix,linux
>> files_to_plot=system("ls *.vec")
> #windows
>> files_to_plot=system("dir /b *.vec")
> #then
>> plot for [ no = 1 : words(files_to_plot) ] word(files_to_plot, no) using 1:2 title 'Flow'.no
> Sincerely
>
> Iva

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Solved: 'plot for' syntax

Yanni
Hello again

I think I got it. I removed the title bit in the "plot for" line and I
got a nice looking graph.

Like this:

plot for [ no = 1 : words(files) ] word(files, no) u 2:3:1 w l lc palette

Thank you very much for pointing me to the right direction.



-------- Forwarded Message --------
Subject: Re: [Gnuplot-info] 'plot for' syntax
Date: Mon, 13 Feb 2017 11:42:03 +0000
From: Yanni <[hidden email]>
To: [hidden email]
CC: [hidden email]



Hi Ivana

Many thanks for your reply. The result is all squeezed. This is my
little script:

------------------------------------------------------------------------------

set term pdf
set output 'test.pdf'
set size square
set xrange [1:4000]
set yrange [1:4000]
set palette defined (0 "black", 1 "red", 2 "orange", 3 "green", 4 "blue")

files= system ("ls *.vec")
#files= "file.vec"

pointsize = 1.5

#plot for [ no = 1 : words(files) ] word(files, no) using 1:2 title
'Flow'.no
#plot files u 2:3:1 w l lc palette

plot for [ no = 1 : words(files) ] word(files, no) using 1:2 title
'Flow'.no u 2:3:1 w l lc palette

------------------------------------------------------------------------------

Before I found out about "plot for". I was plotting each file
individually using:

plot files u 2:3:1 w l lc palette

If I try to add these parameters: (u 2:3:1 w l lc pallette) into the
"plot for" syntax, in oder to get a better looking graph, gnuplot is not
happy and gives me this error:

"gnuplotloop.script", line 15: unexpected or unrecognized token

Line 15 is the "plot for" line. Could you please let me know how can I
add these parametes in the "plot for" syntax?

Thank you



On 13/02/17 10:42, ivana richterova wrote:

> Hi Goud,
>
>> plot for [x=1:10] '*.vec' using 1:2 title 'Flow'.x
> this is not how it works.
>
> I guess you this solution:
> #unix,linux
>> files_to_plot=system("ls *.vec")
> #windows
>> files_to_plot=system("dir /b *.vec")
> #then
>> plot for [ no = 1 : words(files_to_plot) ] word(files_to_plot, no) using 1:2 title 'Flow'.no
> Sincerely
>
> Iva

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Loading...