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


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

plotting data directly from an Internet link?

Started byTonyG <tgozdz@gmail.com>
First post2012-10-29 10:15 -0700
Last post2012-10-31 06:44 -0700
Articles 7 — 3 participants

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


Contents

  plotting data directly from an Internet link? TonyG <tgozdz@gmail.com> - 2012-10-29 10:15 -0700
    Re: plotting data directly from an Internet link? James <jjpuzzles@wowway.com> - 2012-10-29 13:00 -0700
      Re: plotting data directly from an Internet link? TonyG <tgozdz@gmail.com> - 2012-10-29 15:19 -0700
    Re: plotting data directly from an Internet link? sfeam <sfeam@users.sourceforge.net> - 2012-10-29 18:53 -0700
      Re: plotting data directly from an Internet link? TonyG <tgozdz@gmail.com> - 2012-10-30 08:56 -0700
        Re: plotting data directly from an Internet link? sfeam <sfeam@users.sourceforge.net> - 2012-10-30 22:54 -0700
          Re: plotting data directly from an Internet link? TonyG <tgozdz@gmail.com> - 2012-10-31 06:44 -0700

#1446 — plotting data directly from an Internet link?

FromTonyG <tgozdz@gmail.com>
Date2012-10-29 10:15 -0700
Subjectplotting data directly from an Internet link?
Message-ID<cf7a8cca-4187-432d-84f9-1c6df0bf7871@googlegroups.com>
Is it possible to use an Internet link to some column-formatted data as the data source for the 'file' part of the 'plot' command?  

A good example would be plotting selected columns from http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt

BTW, since I use a WinXP OS, I doubt I could use the pop(x) method as described in the Help file, e.g.,

pop(x) = 103*exp(-x/10)
plot "< awk '{print $1-1965, $2}' population.dat", pop(x)

[toc] | [next] | [standalone]


#1451

FromJames <jjpuzzles@wowway.com>
Date2012-10-29 13:00 -0700
Message-ID<8f63f2b6-6b58-4b3a-b25c-0c86bdf84cb1@4g2000yql.googlegroups.com>
In reply to#1446
On Oct 29, 1:15 pm, TonyG <tgo...@gmail.com> wrote:
> Is it possible to use an Internet link to some column-formatted data as the data source for the 'file' part of the 'plot' command?

I don't know how to do it directly from gnuplot, but it would be easy
enough to use a command-line program like wget to copy the file to
your hard drive prior to calling gnuplot.

--
Good luck,
James

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


#1453

FromTonyG <tgozdz@gmail.com>
Date2012-10-29 15:19 -0700
Message-ID<8dcef60d-b5fe-467f-b0d2-9429178c2bb5@googlegroups.com>
In reply to#1451
On Monday, October 29, 2012 4:00:37 PM UTC-4, James wrote:
> On Oct 29, 1:15 pm, TonyG <tgo...@gmail.com> wrote:
> 
> > Is it possible to use an Internet link to some column-formatted data as the data source for the 'file' part of the 'plot' command?
> 
> 
> 
> I don't know how to do it directly from gnuplot, but it would be easy
> 
> enough to use a command-line program like wget to copy the file to
> 
> your hard drive prior to calling gnuplot.
> 
> 
> 
> --
> 
> Good luck,
> 
> James

Thanks, James--but this is exactly the path I'm trying to avoid; I'm looking, and still hoping, for a 'pure way' to pull this trick...

--Tony

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


#1454

Fromsfeam <sfeam@users.sourceforge.net>
Date2012-10-29 18:53 -0700
Message-ID<k6nbur$pep$1@dont-email.me>
In reply to#1446
TonyG wrote:

> Is it possible to use an Internet link to some column-formatted data
> as the data source for the 'file' part of the 'plot' command?
> 
> A good example would be plotting selected columns from
> http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt
> 
> BTW, since I use a WinXP OS, I doubt I could use the pop(x) method as
> described in the Help file, e.g.,
> 
> pop(x) = 103*exp(-x/10)
> plot "< awk '{print $1-1965, $2}' population.dat", pop(x)


You say "I doubt I could use....".
But have you actually tried it?
So long as the gnuplot executable supports pipes, you should
be OK.

At least under linux one answer is
  plot "< GET http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"

where GET is a widely-distributed perl script roughly equivalent
to wget.  If you prefer wget, then 
  plot "< wget -O - http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"

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


#1455

FromTonyG <tgozdz@gmail.com>
Date2012-10-30 08:56 -0700
Message-ID<9ceb5771-afd5-4a4e-b90e-00f8f283626a@googlegroups.com>
In reply to#1454
On Monday, October 29, 2012 9:53:32 PM UTC-4, sfeam wrote:
> TonyG wrote:
> 
> 
> 
> > Is it possible to use an Internet link to some column-formatted data
> 
> > as the data source for the 'file' part of the 'plot' command?
> 
> > 
> 
> > A good example would be plotting selected columns from
> 
> > http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt
> 
> > 
> 
> > BTW, since I use a WinXP OS, I doubt I could use the pop(x) method as
> 
> > described in the Help file, e.g.,
> 
> > 
> 
> > pop(x) = 103*exp(-x/10)
> 
> > plot "< awk '{print $1-1965, $2}' population.dat", pop(x)
> 
> 
> 
> 
> 
> You say "I doubt I could use....".
> 
> But have you actually tried it?

Now I have... ;-)

> 
> So long as the gnuplot executable supports pipes, you should
> 
> be OK.

Yes, I'm using gnuplot_pipes as my default executable.  (BTW, why are there two versions if gnuplot_pipes has more capabilities; is there something missing in it in comparison to std. gnuplot?)

> 
> 
> 
> At least under linux one answer is
> 
>   plot "< GET http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"
> 
> 
> 
> where GET is a widely-distributed perl script roughly equivalent
> 
> to wget.  If you prefer wget, then 
> 
>   plot "< wget -O - http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"

Thanks; wget works, and downloads and displays the data when used from the command line.  However, it bombs out when used inside gnuplot:

gnuplot> plot "< wget -O - http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt" using ($13) w lp  
         warning: Skipping unreadable file "< wget -O - http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"
         No data in plot

The input file has a two-row header:

#YY  MM DD hh mm WDIR WSPD GST  WVHT   DPD   APD MWD   PRES  ATMP  WTMP  DEWP  VIS PTDY  TIDE
#yr  mo dy hr mn degT m/s  m/s     m   sec   sec degT   hPa  degC  degC  degC  nmi  hPa    ft
2012 10 30 14 50 120  6.0  8.0   3.1    11   7.2 104 1001.2  14.0  12.4  12.5   MM +2.8    MM
2012 10 30 13 50 130  8.0  9.0   3.3    10   7.6  95 1000.4  14.1  12.4  12.6   MM +2.6    MM

but in my experience gnuplot handles such cases easily...  I have tried various changes, but to no avail--I'm stuck.

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


#1457

Fromsfeam <sfeam@users.sourceforge.net>
Date2012-10-30 22:54 -0700
Message-ID<k6qef5$2ac$1@dont-email.me>
In reply to#1455
TonyG wrote:

> On Monday, October 29, 2012 9:53:32 PM UTC-4, sfeam wrote:
>> TonyG wrote:
>> 
>> 
>> 
>> > Is it possible to use an Internet link to some column-formatted
>> > data
>> 
>> > as the data source for the 'file' part of the 'plot' command?
>> 
>> > 
>> 
>> > A good example would be plotting selected columns from
>> 
>> > http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt
>> 
>> > 
>> 
>> > BTW, since I use a WinXP OS, I doubt I could use the pop(x) method
>> > as
>> 
>> > described in the Help file, e.g.,
>> 
>> > 
>> 
>> > pop(x) = 103*exp(-x/10)
>> 
>> > plot "< awk '{print $1-1965, $2}' population.dat", pop(x)
>> 
>> 
>> 
>> 
>> 
>> You say "I doubt I could use....".
>> 
>> But have you actually tried it?
> 
> Now I have... ;-)
> 
>> 
>> So long as the gnuplot executable supports pipes, you should
>> 
>> be OK.
> 
> Yes, I'm using gnuplot_pipes as my default executable.  (BTW, why are
> there two versions if gnuplot_pipes has more capabilities; is there
> something missing in it in comparison to std. gnuplot?)

Good question.  I'm not a Windows user, but my understanding is
that the distinction went away in version 4.6 because all the 
functionality of both the previous versions is in the single
executable gnuplot.exe


>> At least under linux one answer is
>> 
>>   plot "< GET http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"
>> 
>> 
>> 
>> where GET is a widely-distributed perl script roughly equivalent
>> 
>> to wget.  If you prefer wget, then
>> 
>>   plot "< wget -O -
>>   http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"
> 
> Thanks; wget works, and downloads and displays the data when used from
> the command line.  However, it bombs out when used inside gnuplot:
> 
> gnuplot> plot "< wget -O -
> http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt" using ($13) w lp
>          warning: Skipping unreadable file "< wget -O -
>          http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt" No data
>          in plot
> 
> The input file has a two-row header:
> 
> #YY  MM DD hh mm WDIR WSPD GST  WVHT   DPD   APD MWD   PRES  ATMP 
> #WTMP  DEWP  VIS PTDY  TIDE
> #yr  mo dy hr mn degT m/s  m/s     m   sec   sec degT   hPa  degC 
> #degC  degC  nmi  hPa    ft
> 2012 10 30 14 50 120  6.0  8.0   3.1    11   7.2 104 1001.2  14.0 
> 12.4  12.5   MM +2.8    MM
> 2012 10 30 13 50 130  8.0  9.0   3.3    10   7.6  95 1000.4  14.1 
> 12.4  12.6   MM +2.6    MM
> 
> but in my experience gnuplot handles such cases easily...  I have
> tried various changes, but to no avail--I'm stuck.

I don't know.  That command works for me under linux.
I get this output:

gnuplot> set term dumb
gnuplot> plot "< wget -O - http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt" using ($13) w lp
--2012-10-30 22:53:12--  http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt
Resolving www.ndbc.noaa.gov (www.ndbc.noaa.gov)... 140.90.238.27
Connecting to www.ndbc.noaa.gov (www.ndbc.noaa.gov)|140.90.238.27|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11468 (11K) [text/plain]
Saving to: “STDOUT”

100%[============================================>] 11,468      48.3K/s   in 0.2s    

2012-10-30 22:53:13 (48.3 KB/s) - written to stdout [11468/11468]

  1025 ++---------+-----------+----------+----------+-----------+----AA-AAA+
       +          +           +          +          +           +   AAAAA+ +
  1020 ++                                                    AAAAAAA      ++
       |                                               AAAAAAA             |
       |                                       AAAAAAAAA                   |
  1015 ++                                AAAAAAA                          ++
       |                             AA A                                  |
  1010 ++                           A  A                                  ++
       |                           A                                       |
       |                         AA                                        |
  1005 ++                       A                                         ++
       | A AAAAA              AA                                           |
  1000 AA A    AA            AA                                           ++
       |         AA          A                                             |
   995 ++         AA        A                                             ++
       |            AA     A                                               |
       |              A A  A                                               |
   990 ++              A AA                                               ++
       +          +           +          +          +           +          +
   985 ++---------+-----------+----------+----------+-----------+---------++
       0          20          40         60         80         100        120



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


#1458

FromTonyG <tgozdz@gmail.com>
Date2012-10-31 06:44 -0700
Message-ID<c1f7353a-7493-447f-b2bb-2b116286df67@googlegroups.com>
In reply to#1457
On Wednesday, October 31, 2012 1:54:46 AM UTC-4, sfeam wrote:
> TonyG wrote:
> 
> 
> 
> > On Monday, October 29, 2012 9:53:32 PM UTC-4, sfeam wrote:
> 
> >> TonyG wrote:
> 
> >> 
> 
> >> 
> 
> >> 
> 
> >> > Is it possible to use an Internet link to some column-formatted
> 
> >> > data
> 
> >> 
> 
> >> > as the data source for the 'file' part of the 'plot' command?
> 
> >> 
> 
> >> > 
> 
> >> 
> 
> >> > A good example would be plotting selected columns from
> 
> >> 
> 
> >> > http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt
> 
> >> 
> 
> >> > 
> 
> >> 
> 
> >> > BTW, since I use a WinXP OS, I doubt I could use the pop(x) method
> 
> >> > as
> 
> >> 
> 
> >> > described in the Help file, e.g.,
> 
> >> 
> 
> >> > 
> 
> >> 
> 
> >> > pop(x) = 103*exp(-x/10)
> 
> >> 
> 
> >> > plot "< awk '{print $1-1965, $2}' population.dat", pop(x)
> 
> >> 
> 
> >> 
> 
> >> 
> 
> >> 
> 
> >> 
> 
> >> You say "I doubt I could use....".
> 
> >> 
> 
> >> But have you actually tried it?
> 
> > 
> 
> > Now I have... ;-)
> 
> > 
> 
> >> 
> 
> >> So long as the gnuplot executable supports pipes, you should
> 
> >> 
> 
> >> be OK.
> 
> > 
> 
> > Yes, I'm using gnuplot_pipes as my default executable.  (BTW, why are
> 
> > there two versions if gnuplot_pipes has more capabilities; is there
> 
> > something missing in it in comparison to std. gnuplot?)
> 
> 
> 
> Good question.  I'm not a Windows user, but my understanding is
> 
> that the distinction went away in version 4.6 because all the 
> 
> functionality of both the previous versions is in the single
> 
> executable gnuplot.exe
> 
> 
> 
> 
> 
> >> At least under linux one answer is
> 
> >> 
> 
> >>   plot "< GET http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"
> 
> >> 
> 
> >> 
> 
> >> 
> 
> >> where GET is a widely-distributed perl script roughly equivalent
> 
> >> 
> 
> >> to wget.  If you prefer wget, then
> 
> >> 
> 
> >>   plot "< wget -O -
> 
> >>   http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt"
> 
> > 
> 
> > Thanks; wget works, and downloads and displays the data when used from
> 
> > the command line.  However, it bombs out when used inside gnuplot:
> 
> > 
> 
> > gnuplot> plot "< wget -O -
> 
> > http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt" using ($13) w lp
> 
> >          warning: Skipping unreadable file "< wget -O -
> 
> >          http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt" No data
> 
> >          in plot
> 
> > 
> 
> > The input file has a two-row header:
> 
> > 
> 
> > #YY  MM DD hh mm WDIR WSPD GST  WVHT   DPD   APD MWD   PRES  ATMP 
> 
> > #WTMP  DEWP  VIS PTDY  TIDE
> 
> > #yr  mo dy hr mn degT m/s  m/s     m   sec   sec degT   hPa  degC 
> 
> > #degC  degC  nmi  hPa    ft
> 
> > 2012 10 30 14 50 120  6.0  8.0   3.1    11   7.2 104 1001.2  14.0 
> 
> > 12.4  12.5   MM +2.8    MM
> 
> > 2012 10 30 13 50 130  8.0  9.0   3.3    10   7.6  95 1000.4  14.1 
> 
> > 12.4  12.6   MM +2.6    MM
> 
> > 
> 
> > but in my experience gnuplot handles such cases easily...  I have
> 
> > tried various changes, but to no avail--I'm stuck.
> 
> 
> 
> I don't know.  That command works for me under linux.
> 
> I get this output:
> 
> 
> 
> gnuplot> set term dumb
> 
> gnuplot> plot "< wget -O - http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt" using ($13) w lp
> 
> --2012-10-30 22:53:12--  http://www.ndbc.noaa.gov/data/5day2/44013_5day.txt
> 
> Resolving www.ndbc.noaa.gov (www.ndbc.noaa.gov)... 140.90.238.27
> 
> Connecting to www.ndbc.noaa.gov (www.ndbc.noaa.gov)|140.90.238.27|:80... connected.
> 
> HTTP request sent, awaiting response... 200 OK
> 
> Length: 11468 (11K) [text/plain]
> 
> Saving to: “STDOUT”
> 
> 
> 
> 100%[============================================>] 11,468      48.3K/s   in 0.2s    
> 
> 
> 
> 2012-10-30 22:53:13 (48.3 KB/s) - written to stdout [11468/11468]
> 
> 
> 
>   1025 ++---------+-----------+----------+----------+-----------+----AA-AAA+
> 
>        +          +           +          +          +           +   AAAAA+ +
> 
>   1020 ++                                                    AAAAAAA      ++
> 
>        |                                               AAAAAAA             |
> 
>        |                                       AAAAAAAAA                   |
> 
>   1015 ++                                AAAAAAA                          ++
> 
>        |                             AA A                                  |
> 
>   1010 ++                           A  A                                  ++
> 
>        |                           A                                       |
> 
>        |                         AA                                        |
> 
>   1005 ++                       A                                         ++
> 
>        | A AAAAA              AA                                           |
> 
>   1000 AA A    AA            AA                                           ++
> 
>        |         AA          A                                             |
> 
>    995 ++         AA        A                                             ++
> 
>        |            AA     A                                               |
> 
>        |              A A  A                                               |
> 
>    990 ++              A AA                                               ++
> 
>        +          +           +          +          +           +          +
> 
>    985 ++---------+-----------+----------+----------+-----------+---------++
> 
>        0          20          40         60         80         100        120

And now, suddenly and for an unexplained reason, I am getting the same result as yours, both with dumb and windows terminals.

You've been most helpful, thank you.

--Tony

[toc] | [prev] | [standalone]


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


csiph-web