Hi,
On Tue, 19 Apr 2011 13:09:23 -0700 (PDT)
Michael Rawlins rawlin...@yahoo.com
wrote:
I'm reading
the latitudes and longitudes from a file, with each lat, lon pair on
each record (line).
I use loadtxt for this purpose.
http://www.scipy.org/Cookbook/InputOutput
I'm trying to plot a series of points/locations on a map. I'm reading the
latitudes and longitudes from a file, with each lat, lon pair on each record
(line). Here is the code:
def make_float(line):
lati, longi = line.split()
return float(lati), float(longi)
my_dict = {}
with
To clarify, you are trying to read in a set of (lat,lon) points in a file
that is space delimited, store the data, and then put a text marker at each
point, with each point numbered in order? The critical part is that you
want to use a list (or numpy array) instead of a dictionary. Something
:
From: Ian Bell ib...@purdue.edu
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: Michael Rawlins rawlin...@yahoo.com
Cc: Matplotlib-users@lists.sourceforge.net
Date: Tuesday, April 19, 2011, 6:52 PM
To clarify, you are trying to read in a set of (lat,lon) points
many values to unpack
There are 203 records in the data file. Line 319 of test.py is this:
(lat,lon)=line.strip().split(' ')
--- On *Tue, 4/19/11, Ian Bell ib...@purdue.edu* wrote:
From: Ian Bell ib...@purdue.edu
Subject: Re: [Matplotlib-users] plotting points/locations from data file
Bell ib...@purdue.edu
Subject: Re:
[Matplotlib-users] plotting points/locations from data file
To: Michael Rawlins rawlin...@yahoo.com
Cc: Matplotlib-users@lists.sourceforge.net
Date: Tuesday, April 19, 2011, 6:52 PM
To clarify, you are trying to read in a set of (lat,lon) points in a file
the '-' be causing a problem? I need to input
the lat, lon as in the file as shown above.
Mike
--- On *Tue, 4/19/11, Ian Bell ib...@purdue.edu* wrote:
From: Ian Bell ib...@purdue.edu
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: Michael Rawlins rawlin
--- On *Tue, 4/19/11, Ian Bell ib...@purdue.edu* wrote:
From: Ian Bell ib...@purdue.edu
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: Michael Rawlins rawlin...@yahoo.com
Cc: Matplotlib-users@lists.sourceforge.net
Date: Tuesday, April 19, 2011, 7:22 PM
above.
Mike
--- On *Tue, 4/19/11, Ian Bell ib...@purdue.edu* wrote:
From: Ian Bell ib...@purdue.edu
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: Michael Rawlins rawlin...@yahoo.com
Cc: Matplotlib-users@lists.sourceforge.net
Date: Tuesday, April 19, 2011, 7
...@purdue.edu
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: G Jones glenn.calt...@gmail.com
Cc: Michael Rawlins rawlin...@yahoo.com,
Matplotlib-users@lists.sourceforge.net
Date: Tuesday, April 19, 2011, 7:35 PM
Have to say I whole-heartedly agree with Glenn. One
mpl_toolkits.basemap import Basemap, shiftgrid, cm
from mpl_toolkits.basemap import NetCDFFile
from pylab import *
--- On *Tue, 4/19/11, Ian Bell ib...@purdue.edu* wrote:
From: Ian Bell ib...@purdue.edu
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: G Jones glenn.calt
to mass produce
--- On Tue, 4/19/11, G Jones glenn.calt...@gmail.com wrote:
From: G Jones glenn.calt...@gmail.com
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: Michael Rawlins rawlin...@yahoo.com
Cc: Ian Bell ib...@purdue.edu, Matplotlib-users
On second thought, the code requires basemap package too.
Mike
--- On Tue, 4/19/11, Michael Rawlins rawlin...@yahoo.com wrote:
From: Michael Rawlins rawlin...@yahoo.com
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: G Jones glenn.calt...@gmail.com
Cc: Matplotlib
='portrait')
#else:
#show()
#plt.savefig('map.png')
plt.savefig('map.eps')
# comment show to mass produce
--- On *Tue, 4/19/11, G Jones glenn.calt...@gmail.com* wrote:
From: G Jones glenn.calt...@gmail.com
Subject: Re: [Matplotlib-users] plotting points/locations from data file
command and
paste them into the source code. Not ideal but will get the job done.
Mike
--- On Tue, 4/19/11, G Jones glenn.calt...@gmail.com wrote:
From: G Jones glenn.calt...@gmail.com
Subject: Re: [Matplotlib-users] plotting points/locations from data file
To: Michael Rawlins rawlin
15 matches
Mail list logo