title: Drawing a graph with NetworkX on a Basemap
body: <p>I want to plot a graph on a map where the nodes would be defined by coordinates (lat, long) and have some value associated.</p>
  
  <p>I have been able to plot points as a scatterplot on a basemap but can't seem to find how to plot a graph on the map.</p>
  
  <p>Thanks. </p>
  
  <p><b>EDIT</b>: I have added code on how I plotted the points on a basemap. Most of it has been adapted from code in <a href="http://sensitivecities.com/so-youd-like-to-make-a-map-using-python-EN.html" rel="noreferrer">this</a> article.</p>
  
  <pre><code>from mpl_toolkits.basemap import Basemap
  from shapely.geometry import Point, MultiPoint
  import pandas as pd
  import matplotlib.pyplot as plt
  
  m = Basemap(
          projection='merc',
          ellps = 'WGS84',
          llcrnrlon=-130,
          llcrnrlat=25,
          urcrnrlon=-60,
          urcrnrlat=50,
          lat_ts=0,
          resolution='i',
          suppress_ticks=True)
  
  # Create Point objects in map coordinates from dataframe lon
  # and lat values
  # I have a dataframe of coordinates
  map_points = pd.Series(
                  [Point(m(mapped_x, mapped_y)) 
                   for mapped_x, mapped_y in zip(df['lon'],
                                                 df['lat'])])
  amre_points = MultiPoint(list(map_points.values)) 
  
  plt.clf()
  fig = plt.figure()
  ax = fig.add_subplot(111, axisbg='w', frame_on=False)
  fig.set_size_inches(18.5, 10.5)
  
  # Create a scatterplot on the map
  dev = m.scatter(
              [geom.x for geom in map_points],
              [geom.y for geom in map_points],
              20, marker='o', lw=.25,
              facecolor='#33ccff', edgecolor='w',
              alpha=0.9,antialiased=True,
              zorder=3)
  
  m.fillcontinents(color='#555555')
  </code></pre>
  
  <p>I get this image:
  <img src="https://i.stack.imgur.com/UK3ko.png" alt="Map"></p>