|
From: Ethan A M. <merritt@u.washington.edu> - 2006-08-07 04:19:48
|
On Sunday 06 August 2006 09:07 pm, Dmitri A. Sergatskov wrote:
> > For what it's worth...
> > Your "NaN" strings *are* being read as legal IEEE format numbers.
> > Using "set datafile missing ..." is not the issue.
> > The issue is what to do when a number is not legal (NaN, Inf,
> > underflow).
>
> It is an issue, because previously I did not bother to check
> if NaNs in my files written as "NaN" or as "nan".
gnuplot reads the number using strtod().
The linux man page for strtod() says:
An infinity is either ``INF'' or ``INFINITY'', disregarding case.
A NAN is ``NAN'' (disregarding case) optionally followed by `(', a
sequence of characters, followed by ')'. The character string speci-
fies in an implementation-dependent way the type of NAN.
> Also, how do I handle file that has both "NaN" and "Inf"?
They are the same, for this purpose.
Do not try to describe them via "set datafile missing";
just let them be read in as floating point numbers.
It is in general not safe to read files without the "using"
specifier unless you are absolutely certain what each line contains.
We have tried to maintain backwards compatibility with old behaviour,
but recent extensions and new plot modes require "using" in order
to work at all. For example, in order to read color information from
the data file, or point size, you need extra columns. But if you
do not tell the program which column is which, it will get confused
and plot the wrong thing altogether.
> A simple benchmark (time gnuplot < cmd) shows that (on my computer
> at least) plot "file" using ($1):($2) takes about 150% as long
> as plot "file".
That's a bit hard to believe.
How big are your data files?
Do they have many columns per line, or only two?
(This used to be an issue but I thought we fixed it).
Are you willing/able to run profiling so that you can tell us
which routine[s] the time is being lost to?
EAM
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|