Re: [Matplotlib-users] plotting points/locations from data file

2011-04-20 Thread Heiko Bauke
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

[Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Michael Rawlins
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Ian Bell
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Michael Rawlins
: 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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Ian Bell
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Michael Rawlins
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread G Jones
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Ian Bell
--- 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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Ian Bell
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Michael Rawlins
...@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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread G Jones
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Michael Rawlins
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Michael Rawlins
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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread G Jones
='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

Re: [Matplotlib-users] plotting points/locations from data file

2011-04-19 Thread Michael Rawlins
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