|
From: Theo <th...@gm...> - 2013-10-20 09:57:21
|
Hi there, I have data files with missing data. e.g. the following TAB-separated file with 4 columns. 13.05.2013 0 1 16.4 14.05.2013 0 16.5 15.05.2013 0 16.2 16.05.2013 0 17 17.05.2013 0 16.6 18.05.2013 0 1 19.05.2013 0 1 20.05.2013 0 1 17.2 21.05.2013 0 16.8 22.05.2013 0 16.9 23.05.2013 0 16.9 If I want to plot column 4 gnuplot seems to plot only the data where there are 4 values in the row. If I want to plot column 3 it plots mostly data of column 4. Since gnuplot has the option to define how it should handle missing data I expected that set datafile missing "" # empty string will solve the issue. But it doesn't work. plot 'Data.dat' u 1:4 with lines plot 'Data.dat' u 1:($4) with lines doesn't work either. And 'help missing' doesn't help me further. I do not want to change all the missing data to '?' or 'NaN'. Any spreadsheet program manages to import correctly such data with empty fields. So I expected that gnuplot can also do it... Any option that I missed? Thanks, Theo. |
|
From: BBands <bb...@gm...> - 2013-10-20 14:16:53
|
I am not near a running gp version but does 'set datafile separator "\t"' help?
John
On Sun, Oct 20, 2013 at 2:56 AM, Theo <th...@gm...> wrote:
> Hi there,
> I have data files with missing data.
> e.g. the following TAB-separated file with 4 columns.
>
> 13.05.2013 0 1 16.4
> 14.05.2013 0 16.5
> 15.05.2013 0 16.2
> 16.05.2013 0 17
> 17.05.2013 0 16.6
> 18.05.2013 0 1
> 19.05.2013 0 1
> 20.05.2013 0 1 17.2
> 21.05.2013 0 16.8
> 22.05.2013 0 16.9
> 23.05.2013 0 16.9
>
> If I want to plot column 4 gnuplot seems to plot only the data where
> there are 4 values in the row. If I want to plot column 3 it plots
> mostly data of column 4.
> Since gnuplot has the option to define how it should handle missing data
> I expected that
>
> set datafile missing "" # empty string
>
> will solve the issue. But it doesn't work.
> plot 'Data.dat' u 1:4 with lines
> plot 'Data.dat' u 1:($4) with lines
> doesn't work either.
> And 'help missing' doesn't help me further.
> I do not want to change all the missing data to '?' or 'NaN'.
> Any spreadsheet program manages to import correctly such data with empty
> fields. So I expected that gnuplot can also do it...
> Any option that I missed?
|
|
From: Theo <th...@gm...> - 2013-10-20 19:42:15
|
unfortunately not...
help says:
set datafile separator {"<char>" | whitespace}
default is whitespace
isn't that either \s or \t ?
Anyway,
set datafile separator "\t"
does not help...
|
|
From: Ethan A M. <eam...@gm...> - 2013-10-20 20:04:16
|
On Sunday, 20 October 2013 09:41:50 PM Theo wrote:
> unfortunately not...
>
> help says:
> set datafile separator {"<char>" | whitespace}
>
> default is whitespace
> isn't that either \s or \t ?
>
> Anyway,
> set datafile separator "\t"
> does not help...
That's odd. It should.
After saying "set datafile separator '\t'" an empty column should
nevertheless be recognized as a column. So values in column 4
should never bleed into column 3 as you described originally.
As to whether an empty column is treated as zero or missing or
bad, I'm afraid that depends on the gnuplot version.
Current gnuplot (4.6.4 and 4.7) treat empty columns as missing data.
Earlier versions treated it as "bad" if you tried to plot it but
(I think) properly ignored it if the columns was not mentioned in
the using spec.
Ethan
|
|
From: Theo <th...@gm...> - 2013-10-21 06:16:56
|
Hi Ethan, if you take the following simple datafile 'Data.dat' 0 2.0 3.0 4.0 1 2.1 3.1 4.1 2 3.2 4.2 3 2.3 4.3 4 2.4 4.4 5 2.5 3.5 4.5 6 2.6 3.6 7 2.7 3.7 8 2.8 3.8 4.8 9 2.9 3.9 4.9 set datafile separator '\t' plot 'Data.dat' u 1:($2) with lines, '' u 1:($3) with lines, '' u 1:($4) with lines You should get three parallel lines where all lines should be interrupted. As you can see in the plot (I try to attach the plot), they are not. I am using gnuplot 4.6.3 A version 4.6.4 or 4.7 windows executable is not (yet) available on sourceforge. So, alternatively, I would have to figure out how I can compile 4.6.4 or 4.7 on my computer. Haven't done it before. This might take a while. Theo. |
|
From: Theo <th...@gm...> - 2013-10-21 06:38:56
|
OK, it seems to be solved... also in version 4.6.3 If you additionally enter set datafile missing "" # empty string So you have to use both Hi Ethan, if you take the following simple datafile 0 2.0 3.0 4.0 1 2.1 3.1 4.1 2 3.2 4.2 3 2.3 4.3 4 2.4 4.4 5 2.5 3.5 4.5 6 2.6 3.6 7 2.7 3.7 8 2.8 3.8 4.8 9 2.9 3.9 4.9 set datafile separator '\t' plot 'Data.dat' u 1:($2) with lines, '' u 1:($3) with lines, '' u 1:($4) with lines You should get three parallel lines where all lines should be interrupted. As you can see in the plot, they are not. I am using gnuplot 4.6.3 A version 4.6.4 or 4.7 windows executable is not (yet) available on sourceforge. So, alternatively, I would have to figure out how I can compile 4.6.4 or 4.7 on my computer. Haven't done it before. This might take a while. Theo. then it draws the data as interrupted lines, as expected. |
|
From: Theo <th...@gm...> - 2013-10-21 06:45:11
|
Sorry, for the confusing previous post OK, it seems to be solved... also in version 4.6.3 If you additionally enter set datafile missing "" # empty string Only if you use both set datafile missing "" set datafile separator '\t' plot 'Data.dat' u 1:($2) with lines, '' u 1:($3) with lines, '' u 1:($4) with lines then it will draws the data as interrupted lines, as expected. |
|
From: Theo <th...@gm...> - 2013-10-25 08:53:17
|
I have to bother you again. The missing data seems not work with matrix data. If I take the following TAB-separated matrix 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7 plot 'Matrix.dat' matrix with image I get the expected plot. However, if e.g. I leave out the 4s in the matrix 1 2 3 2 3 5 3 5 6 5 6 7 and additionally apply: set datafile missing "" set datafile separator "\t" I get the error messages: "Matrix does not represent a grid" or "warning: matrix contains missing or undefined values" So, it seems that if values in the first line are missing it's not working...? Any idea to plot the data nevertheless without inserting '0' or 'NaN'? |
|
From: Ethan M. <eam...@gm...> - 2013-10-25 18:49:50
|
You have found a bug. The problem is specifically the row that has an empty field in the first column. All the other empty fields are correctly recognized but that one is not. I don't have an immediate work-around to offer but I'm sure it's fixable. On Fri, Oct 25, 2013 at 1:52 AM, Theo <th...@gm...> wrote: > I have to bother you again. > The missing data seems not work with matrix data. > > If I take the following TAB-separated matrix > > 1 2 3 4 > 2 3 4 5 > 3 4 5 6 > 4 5 6 7 > > plot 'Matrix.dat' matrix with image > > I get the expected plot. > > However, if e.g. I leave out the 4s in the matrix > 1 2 3 > 2 3 5 > 3 5 6 > 5 6 7 > > and additionally apply: > > set datafile missing "" > set datafile separator "\t" > > I get the error messages: > "Matrix does not represent a grid" > or > "warning: matrix contains missing or undefined values" > > So, it seems that if values in the first line are missing it's not > working...? > Any idea to plot the data nevertheless without inserting '0' or 'NaN'? > > > > > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > Membership management via: > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |
|
From: Theo <th...@gm...> - 2014-01-25 07:45:29
|
will this be fixed in gnuplot 4.7 or later? > You have found a bug. > The problem is specifically the row that has an empty field in the first > column. All the other empty fields are correctly recognized but that one > is not. > > I don't have an immediate work-around to offer but I'm sure it's fixable. > |
|
From: Ethan M. <eam...@gm...> - 2014-01-25 16:43:02
|
On Saturday, 25 January 2014 08:45:08 AM Theo wrote: > > will this be fixed in gnuplot 4.7 or later? > > > You have found a bug. > > The problem is specifically the row that has an empty field in the first > > column. All the other empty fields are correctly recognized but that one > > is not. > > > > I don't have an immediate work-around to offer but I'm sure it's fixable. The fix will be in 4.6.5 when it is released - maybe next month. Ethan |