Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: plotting data directly from an Internet link? Followup-To: comp.graphics.apps.gnuplot Date: Tue, 30 Oct 2012 22:54:45 -0700 Organization: gnuplot development team Lines: 132 Message-ID: References: <9ceb5771-afd5-4a4e-b90e-00f8f283626a@googlegroups.com> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Date: Wed, 31 Oct 2012 05:54:45 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="de68407e1e0278021e2f738a9cf7b10c"; logging-data="2380"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WqwYadw48PEWGhObkOcKx" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:3A9vCpUsqLJcdmr9B/jnv8Y0GjE= Xref: csiph.com comp.graphics.apps.gnuplot:1457 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