Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #1457
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: plotting data directly from an Internet link? |
| Followup-To | comp.graphics.apps.gnuplot |
| Date | 2012-10-30 22:54 -0700 |
| Organization | gnuplot development team |
| Message-ID | <k6qef5$2ac$1@dont-email.me> (permalink) |
| References | <cf7a8cca-4187-432d-84f9-1c6df0bf7871@googlegroups.com> <k6nbur$pep$1@dont-email.me> <9ceb5771-afd5-4a4e-b90e-00f8f283626a@googlegroups.com> |
Followups directed to: comp.graphics.apps.gnuplot
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
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
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
csiph-web