title: Plotting a map until the user hits contrl-c Python
body: <p>Hi guys I am trying to draw a bunch of plots on a map and my program is continually plotting these points on the map, but I am wanting it to where it'll draw up the map when the user hits control-c to stop the program. Any idea why this is not drawing up the map when I hit control-c? In theory when the user hits control-c the interrupt keyboard exception will prompt the plt.show()</p>
  
  <pre><code>from tweepy import Stream
  from tweepy import OAuthHandler
  from tweepy.streaming import StreamListener
  from mpl_toolkits.basemap import Basemap
  import matplotlib.pyplot as plt
  import time
  import json
  from HTMLParser import HTMLParser
  import csv
  
  ckey = '
  csecret = '
  atoken = '
  asecret = '
  
  m = Basemap(projection='mill', llcrnrlat=20, urcrnrlat=50,\
          llcrnrlon=-130, urcrnrlon=-60, resolution ='c')
  m.drawcoastlines()
  m.drawcountries()
  m.drawstates()
  m.fillcontinents(color='#04BAE3', lake_color='#FFFFFF')
  m.drawmapboundary(fill_color='#FFFFFF')
  
  class listener(StreamListener):
  
      def on_status(self, status):
  
           try:
              if status.coordinates:
  
                  #print status.text
                  print status.coordinates
                  #print 'place:', status.place.full_name
                  coords  = status.coordinates
                  latitude = coords['coordinates'][0]
                  longitude = coords['coordinates'][1]
                  x,y = m(latitude, longitude)
                  m.plot(x,y,'ro', markersize=20, alpha=.5)
                  print latitude
                  print longitude
  
              return True
           except KeyboardInterrupt, e:
  
              plt.show()
              sys.exit()
         #     time.sleep(5)
  
  
  
      def on_error(self, status):
          print status
  
  auth = OAuthHandler(ckey, csecret)
  auth.set_access_token(atoken, asecret)
  twitterStream = Stream(auth, listener())
  twitterStream.filter(track=["justin", "bieber"])
  </code></pre>