Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Gnuplot inline data and time data format?

157 views
Skip to first unread message

Hans-Bernhard Bröker

unread,
May 1, 2013, 5:02:51 PM5/1/13
to
On 01.05.2013 22:52, nepouzi...@gmail.com wrote:
> Hi.
> I have a problem.
>
> I have data in two columns (UNIX timestamp and float number). I would have time on X-axis.
>
> When data are in a file, then I haven't problem. But when if data are inline, then gnuplot get me an error message:
>
> test2.plt", line 11: Need full using spec for x time data"
>
> What's wrong?

What's wrong is that you changed _two_ things between those two plot
commands, but you're currently looking at only one of them (the type of
file), when you should be looking at the other (the using specification,
as mentioned in the error message you got).


Karl

unread,
May 2, 2013, 7:00:30 PM5/2/13
to


On 01.05.2013 23:02, Hans-Bernhard Bröker wrote:
>
> What's wrong is that you changed _two_ things between those two plot
> commands, but you're currently looking at only one of them (the type
> of file), when you should be looking at the other (the using
> specification, as mentioned in the error message you got).
>

Why is there a difference between saying "using 1:2" and not saying it?

Apart from the timeformat thing, also lines with unexpected content
are handled differently with and without a "using" statement. With
"using", lines with text lacking a # in front of it cause an error,
while with a "using" statement, they are silently ignored.

How does this work internally?

Karl

sfeam

unread,
May 2, 2013, 8:27:26 PM5/2/13
to
If there is no "using" clause, then gnuplot looks at each line to
decide if there is valid data, and if so how many columns of data.
Gnuplot has historically treated each line of input as if it were
independent of any others. That means that if different lines in the
data file have different numbers of columns, or different numbers of
valid columns, you get rather odd results.

So "using 1:2" will accept only input lines that indeed contain valid
data in the first two columns. If there is no "using" clause, then
lines containing 0 or 1 valid columns will be accepted without any
error message but may well not be plotted as you expected.

Note:
This will _change_ in gnuplot version 5 whenever that is released.
It has already been changed in the development version so that in the
absence of a "using" clause the program will effectively construct one
based on the first line of data. That means if later input lines contain
fewer valid columns than the first line, you'll get an error message.


> Karl

0 new messages