|
From: Matthias_D <d00...@nt...> - 2011-10-02 16:31:15
|
Hi,
I'm quite new to use gnuplot. Very complicated, I think. But hope I can
learn it.
My problem (I found a complicated sollution already, but maybe there is a
simple one):
There are many temperatur monitoring stations. The time of their activity
shall be plotted
as a horizontal line (x axis is the time [hours]) as well as the hours of
their malfunktion
(set a "+" on this line).
The x axis is the time [hours] from 1 to 17544 (for 2 years).
Now I arranged the data in one file for each station. Looks like this:
First column is the time (hours), second column shows the beginning and end,
third column shows the errors.
567 1 []
678 [] 1
679 [] 1
....
17543 [] 1
17544 1 []
I inserted the brackets to tell gnuplot that here is no value to plot.
Actually the data is logical. For various stations I choose to replace the
"1" with "2", "3", .....
Then the y axis will be 1, 2, 3 and so on and the data will be plotted
horizontally for each station.
This works fine with one file.
plot "001.txt" using 1:2 w lines,\
"001.txt" using 1:3 w points pt1 ps1,\
"002.txt" u 1:2 w lines,\
"002.txt" u 1:3 w points pt1 ps1
But when I want to plot more files the output becomes miserable.
I expected to add as many files as I want, but this didn't work.
I also tried to put all the data into a single file with many columns, but
it doesn't get better.
Often comes the message " ';' expected. "
Thanks for every hint!
--
View this message in context: http://old.nabble.com/Print-huge-data-into-a-single-plot-tp32578285p32578285.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: Thomas S. <t.s...@fz...> - 2011-10-02 19:54:27
|
it doesn't seem to be a good idea to use brackets (=2 characters) for missing data, better would be to specify something like set datafile missing "?" and use a question mark for missing data. there should be no problem to use many datafiles and assign an individual y-value to each data set, e.g. plot "datafile_1" using 1:2 with lines,\ "" using 1:3 with points pt1 ps1,\ "datafile_2" using 1:(2*$2) with lines,\ "" using 1:(2*$3) with points pt1 ps1,\ "datafile_3" using 1:(3*$2) with lines,\ "" using 1:(3*$3) with points pt1 ps1 please explain what you mean by 'output becomes miserable'? Matthias_D wrote: > > Hi, > I'm quite new to use gnuplot. Very complicated, I think. But hope I can > learn it. > > My problem (I found a complicated sollution already, but maybe there is a > simple one): > > There are many temperatur monitoring stations. The time of their activity > shall be plotted > as a horizontal line (x axis is the time [hours]) as well as the hours of > their malfunktion > (set a "+" on this line). > The x axis is the time [hours] from 1 to 17544 (for 2 years). > > Now I arranged the data in one file for each station. Looks like this: > > First column is the time (hours), second column shows the beginning and > end, third column shows the errors. > > 567 1 [] > 678 [] 1 > 679 [] 1 > .... > 17543 [] 1 > 17544 1 [] > > I inserted the brackets to tell gnuplot that here is no value to plot. > Actually the data is logical. For various stations I choose to replace the > "1" with "2", "3", ..... > Then the y axis will be 1, 2, 3 and so on and the data will be plotted > horizontally for each station. > This works fine with one file. > > plot "001.txt" using 1:2 w lines,\ > "001.txt" using 1:3 w points pt1 ps1,\ > "002.txt" u 1:2 w lines,\ > "002.txt" u 1:3 w points pt1 ps1 > > But when I want to plot more files the output becomes miserable. > > I expected to add as many files as I want, but this didn't work. > > I also tried to put all the data into a single file with many columns, but > it doesn't get better. > > Often comes the message " ';' expected. " > > Thanks for every hint! > -- View this message in context: http://old.nabble.com/Print-huge-data-into-a-single-plot-tp32578285p32579103.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Matthias_D <d00...@nt...> - 2011-10-03 06:39:35
|
I inserted " ? " instead of "[]" in the files. But there is still no usable output. My plotfile looks like this: set datafile missing "?" set autoscale # scale axes automatically unset log # remove any log-scaling unset label # remove any previous labels unset title # remove any previous titles set ytics (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) set xtics (0,2000,4000,6000,8000,10000,12000,14000,16000,17544) set title "Monitoring Data for stations 1 to 30" set xlabel "time [hours]" set ylabel "Stationnumber" set xr [-300:18450] set yr [-1.5:31.5] #I want to print 30 stations on one page plot "1.txt" using 1:2 with lines,\ "" using 1:3 with points pt1 ps1,\ "2.txt" using 1:(2*$2) with lines,\ "" using 1:(2*$3) with points pt1 ps1,\ "3.txt" using 1:(3*$2) with lines,\ "" using 1:(3*$3) with points pt1 ps1 But I still get the message "plot_final.p", line xx: ';' expected (xx) is the last line! I also don't like the data in the upper right corner. Output like this: http://old.nabble.com/file/p32580666/Output1.jpg Thomas Sefzick wrote: > > it doesn't seem to be a good idea to use brackets (=2 characters) for > missing data, better would be to specify something like > > set datafile missing "?" > > and use a question mark for missing data. > > there should be no problem to use many datafiles and > assign an individual y-value to each data set, e.g. > > plot "datafile_1" using 1:2 with lines,\ > "" using 1:3 with points pt1 ps1,\ > "datafile_2" using 1:(2*$2) with lines,\ > "" using 1:(2*$3) with points pt1 ps1,\ > "datafile_3" using 1:(3*$2) with lines,\ > "" using 1:(3*$3) with points pt1 ps1 > > please explain what you mean by 'output becomes miserable'? > > > Matthias_D wrote: >> >> Hi, >> I'm quite new to use gnuplot. Very complicated, I think. But hope I can >> learn it. >> >> My problem (I found a complicated sollution already, but maybe there is a >> simple one): >> >> There are many temperatur monitoring stations. The time of their activity >> shall be plotted >> as a horizontal line (x axis is the time [hours]) as well as the hours of >> their malfunktion >> (set a "+" on this line). >> The x axis is the time [hours] from 1 to 17544 (for 2 years). >> >> Now I arranged the data in one file for each station. Looks like this: >> >> First column is the time (hours), second column shows the beginning and >> end, third column shows the errors. >> >> 567 1 [] >> 678 [] 1 >> 679 [] 1 >> .... >> 17543 [] 1 >> 17544 1 [] >> >> I inserted the brackets to tell gnuplot that here is no value to plot. >> Actually the data is logical. For various stations I choose to replace >> the "1" with "2", "3", ..... >> Then the y axis will be 1, 2, 3 and so on and the data will be plotted >> horizontally for each station. >> This works fine with one file. >> >> plot "001.txt" using 1:2 w lines,\ >> "001.txt" using 1:3 w points pt1 ps1,\ >> "002.txt" u 1:2 w lines,\ >> "002.txt" u 1:3 w points pt1 ps1 >> >> But when I want to plot more files the output becomes miserable. >> >> I expected to add as many files as I want, but this didn't work. >> >> I also tried to put all the data into a single file with many columns, >> but it doesn't get better. >> >> Often comes the message " ';' expected. " >> >> Thanks for every hint! >> > > -- View this message in context: http://old.nabble.com/Print-huge-data-into-a-single-plot-tp32578285p32580666.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Matthias_D <d00...@nt...> - 2011-10-03 07:27:51
|
I can plot every file now, but only one file per plot! Before it worked for two or three files, not more. Is it because I use Windows? I don't understand this behaviour of gnuplot. I didn't know how to set a path for the files, so I put all the files into the directory with gnuplot.exe. But this shouldn't be the problem. "1:(2*$2)" doesn't work with me, too. But I already changed the values in the datafiles, so it's ok for me to use "1:2". Thomas Sefzick wrote: > > there should be no problem to use many datafiles and > assign an individual y-value to each data set, e.g. > > plot "datafile_1" using 1:2 with lines,\ > "" using 1:3 with points pt1 ps1,\ > "datafile_2" using 1:(2*$2) with lines,\ > "" using 1:(2*$3) with points pt1 ps1,\ > "datafile_3" using 1:(3*$2) with lines,\ > "" using 1:(3*$3) with points pt1 ps1 > > -- View this message in context: http://old.nabble.com/Print-huge-data-into-a-single-plot-tp32578285p32580806.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2011-10-03 09:27:12
|
this 'additional stuff' can be removed by set key off the error messages " ... line xx: ';' expected" are due to wrong syntax. it should be " ... with points pt 1 ps 1" note the space between "pt" or "ps" and the number. to get black points you need to specify a linetype or line color in addition: " ... with points pt 1 ps 1 lt 0" " ... with points pt 1 ps 1 lc rgb 'black'" are you using your plot commands file via "load" or via "call"? Matthias_D wrote: > > I can plot every file now, but only one file per plot! > > Before it worked for two or three files, not more. > Is it because I use Windows? I don't understand this behaviour of gnuplot. > > I didn't know how to set a path for the files, so I put all the files into > the > directory with gnuplot.exe. But this shouldn't be the problem. > > "1:(2*$2)" doesn't work with me, too. But I already changed the values > in the datafiles, so it's ok for me to use "1:2", "1:3". > _____________________________________________________ > I finally found a way to plot it. > I copied all the columns into one file, then plot: > plot for [i=2:60:2] "001-030.txt" using 1:i with lines,\ > for [i=3:61:2] "001-030.txt" using 1:i with points pt1 ps1 > > Looks like: > > http://old.nabble.com/file/p32580806/Output2.jpg > > Now only two problems left: > The point marker should not change but stay at "+" (black). > I don't want these additional stuff in the upper right corner. > > > Thomas Sefzick wrote: >> >> there should be no problem to use many datafiles and >> assign an individual y-value to each data set, e.g. >> >> plot "datafile_1" using 1:2 with lines,\ >> "" using 1:3 with points pt1 ps1,\ >> "datafile_2" using 1:(2*$2) with lines,\ >> "" using 1:(2*$3) with points pt1 ps1,\ >> "datafile_3" using 1:(3*$2) with lines,\ >> "" using 1:(3*$3) with points pt1 ps1 >> >> > -- View this message in context: http://old.nabble.com/Print-huge-data-into-a-single-plot-tp32578285p32581304.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Matthias_D <d00...@nt...> - 2011-10-05 05:58:36
|
Ok, I could plot everything now. I put all the relevant data into one file before plotting. Don't know why I couldn't plot many files into one plot. I used "load", not "call" for the script file input. I changed the variables of the file before each run. -- View this message in context: http://old.nabble.com/Print-huge-data-into-a-single-plot-tp32578285p32594333.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |