Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2478 > unrolled thread

Problems with standard input

Started bypaul.d@soi-team.org
First post2014-06-01 16:33 -0700
Last post2014-06-02 01:20 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  Problems with standard input paul.d@soi-team.org - 2014-06-01 16:33 -0700
    Re: Problems with standard input Ethan A Merritt <EAMerritt@gmail.com> - 2014-06-02 00:13 -0700
      Re: Problems with standard input paul.d@soi-team.org - 2014-06-02 01:20 -0700

#2478 — Problems with standard input

Frompaul.d@soi-team.org
Date2014-06-01 16:33 -0700
SubjectProblems with standard input
Message-ID<24a08756-c0ff-477d-91c7-f928d1ac1499@googlegroups.com>
Hi,

I have been trying to plot some data from a Seabird 45 TSG, and it looks like this:

05/31/2014,00:00:32.394,t1= 29.2284, c1= 5.70674, s= 34.6807, sv=1534.075, t2= 25.005
05/31/2014,00:00:33.424,t1= 29.2282, c1= 5.71173, s= 34.7150, sv=1534.112, t2= 25.005

I have not found a way to get gnuplot to deal with the "t1=" type labels, so I've been piping it through multiple instances of sed to get this:

05/31/2014,00:00:32.394, 29.2284,  5.70674,  34.6807, 1534.075,  25.005
05/31/2014,00:00:33.424, 29.2282,  5.71173,  34.7150, 1534.112,  25.005

Which gnuplot will deal with. However, I've not managed to make it take the same data from standard input. If I try to do that, I get this:

plot '-' using 1:3
                 ^
"plotseatemp.gnuplot", line 19: warning: Skipping data file with no valid points

plot '-' using 1:3
                  ^
"plotseatemp.gnuplot", line 19: x range is invalid

The script I'm using is:

# Gnuplot script to plot out some SBE45 data
#
set title "Seabird Temperature"
set xlabel "Date\nTime"
#
#set terminal png
#
# NB: Gnuplot does not understand milliseconds
set timefmt "%m/%d/%Y,%H:%M:%S"
set yrange [20:32]
set xdata time
set datafile separator ","
#
# X-axis data (date/time)
# set xrange [ "05/31/2014":"06/01/2014" ]
set ylabel "Temperature (deg C)" tc lt 2
#
set format x "%d/%m\n%H:%M"
plot '-' using 1:3

If I change the - to test.dat, which contains data in exactly the same format as the piped data coming into standard input, it works fine.

Any ideas where I am going wrong with standard input?

Thanks!

Paul.

[toc] | [next] | [standalone]


#2479

FromEthan A Merritt <EAMerritt@gmail.com>
Date2014-06-02 00:13 -0700
Message-ID<lmh86m$sa2$1@dont-email.me>
In reply to#2478
paul.d@soi-team.org wrote:

> Hi,
> 
> I have been trying to plot some data from a Seabird 45 TSG, and it
> looks like this:
> 
> 05/31/2014,00:00:32.394,t1= 29.2284, c1= 5.70674, s= 34.6807,
> sv=1534.075, t2= 25.005 05/31/2014,00:00:33.424,t1= 29.2282, c1=
> 5.71173, s= 34.7150, sv=1534.112, t2= 25.005
> 
> I have not found a way to get gnuplot to deal with the "t1=" type
> labels, so I've been piping it through multiple instances of sed to
> get this:
> 
> 05/31/2014,00:00:32.394, 29.2284,  5.70674,  34.6807, 1534.075, 
> 25.005
> 05/31/2014,00:00:33.424, 29.2282,  5.71173,  34.7150, 1534.112, 
> 25.005
> 
> Which gnuplot will deal with. However, I've not managed to make it
> take the same data from standard input. If I try to do that, I get
> this:
> 
> plot '-' using 1:3
>                  ^
> "plotseatemp.gnuplot", line 19: warning: Skipping data file with no
> valid points
> 
> plot '-' using 1:3
>                   ^
> "plotseatemp.gnuplot", line 19: x range is invalid
> 
> The script I'm using is:
> 
> # Gnuplot script to plot out some SBE45 data
> #
> set title "Seabird Temperature"
> set xlabel "Date\nTime"
> #
> #set terminal png
> #
> # NB: Gnuplot does not understand milliseconds
> set timefmt "%m/%d/%Y,%H:%M:%S"
> set yrange [20:32]
> set xdata time
> set datafile separator ","
> #
> # X-axis data (date/time)
> # set xrange [ "05/31/2014":"06/01/2014" ]
> set ylabel "Temperature (deg C)" tc lt 2
> #
> set format x "%d/%m\n%H:%M"
> plot '-' using 1:3
> 
> If I change the - to test.dat, which contains data in exactly the same
> format as the piped data coming into standard input, it works fine.
> 
> Any ideas where I am going wrong with standard input?

Your script and data work for me in current gnuplot (4.6.5)
and also an older one I have around (4.4.4).
Is your version even older than that?

Also - gnuplot does understand milliseconds now.

	Ethan


> 
> Thanks!
> 
> Paul.

[toc] | [prev] | [next] | [standalone]


#2480

Frompaul.d@soi-team.org
Date2014-06-02 01:20 -0700
Message-ID<c728f09e-a7be-4fd8-9ef3-38f0ad21fd06@googlegroups.com>
In reply to#2479
Hi Ethan,

Thanks for your reply.

On Monday, June 2, 2014 7:13:23 AM UTC, Ethan A Merritt wrote:
> Your script and data work for me in current gnuplot (4.6.5)
> 
> and also an older one I have around (4.4.4).
> 
> Is your version even older than that?

It is 4.6 patchlevel 1 (the version that is supplied by Linux Mint 15).

> Also - gnuplot does understand milliseconds now.

Oh, thats interesting to know - didn't see that in the time format documentation. I'll take another look.

Very strange about the standard input though... I must be doing something wrong this end.

Thanks again,

Paul.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web