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 open("file.txt") as f: for item in f: lati,longi = make_float(item) my_dict[lati] = longi xpt,ypt = m(-76.1670,39.4670 ) plt.text(xpt,ypt,'1',color='white') #print my_dict The matplotlib code which I've previously used to plot a single point on the map is below, with longitude and latitude in ( ): xpt,ypt = m(-70.758392,42.960445) plt.text(xpt,ypt,'1',color='white') When replacing (-70.758392,42.960445) with (longi,lati), the code plots only a single '1' at the location of just the last coordinate pair in the file. So now I only need to plot them all. Does the code I've implemented have an implicit loop to it? Mike ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users