|
From: Ethan A M. <sf...@us...> - 2014-04-23 18:49:22
|
On Sunday, 20 April, 2014 10:48:10 pl...@pi... wrote:
> HI,
>
>
> I often use conditional using clauses to plot part of a range of data
>
> plot datafile using (($1<=1995.55)?$1:NaN):(2*fcos1($1))
>
> I tried this when writing to a file specified with "set table" and
> instead of cutting off the output, it appends garbage data with a "u".
>
> help table tells me this means "undefined"
>
> I see two problems here. I did not ask for undefined output , I
> specified NaN.
>
> Secondly , what is the possible use of "undefined" values in a data file?
>
> 1995.46 1.00914 i
> 1995.54 1.10947 i
> 1.98547e-81 4.74363e+170 u
> 3.75845e+174 7.52884e-24 u
> 0 2.122e-314 u
> 0 0 u
> 0 0 u
> 1.9771e+161 1.44402e+214 u
> -1.22337e-44 1.1735e-319 u
> 1.01887e+189 7.49746e+247 u
> 5.35166e+199 2.10124e+88 u
I do not know what the original idea was,
nor do I know if there are existing scripts that depend on the 'u'.
It does seem pointless to write out total junk values as in your example.
If it helps, version 5 has a new mode "with table" that does what you want.
gnuplot> set samples 11
gnuplot> set xrange [0:10]
gnuplot> set table
gnuplot> plot '+' using ((4<$1&&$1<8) ? NaN : $1) : ($1**2) with table
0 0
1 1
2 4
3 9
4 16
nan 25
nan 36
nan 49
8 64
9 81
10 100
gnuplot>
This is not ideal because it requires a separate plot style, which means
you can't do
plot $foo; set table; replot
Should tabular output of the regular plot styles be changes to match this?
What, if anything, depends on the old behavior and would break?
Ethan
|