title: Plot point on graph via user input
body: <p>I am really trying to do something simple here, but struggling a lot.</p>
  
  <p>I am trying to get users to input points onto a graph that will update in real time.</p>
  
  <p>Here's the scenario.</p>
  
  <p>My graph will be projected in an exhibition, and then when a user inputs how long it take them to get to work, it then shows that point on the graph. </p>
  
  <p>As more users input their data I will eventually have generated a graph that shows all the inputs relative to each other. </p>
  
  <p>Here is what I ended up doing that worked really well!</p>
  
  <pre><code>from pylab import *
  
  def click(event):
     """If the left mouse button is pressed: draw a little square. """
     tb = get_current_fig_manager().toolbar
     if event.button==1 and event.inaxes and tb.mode == '':
         x,y = event.xdata,event.ydata
         plot([x],[y],'rs')
         draw()
  
  plt.title('How long does it take you to get to work?\nClick the spot.')
  plt.xlabel('Kms')
  plt.ylabel('Hours')
  plt.legend()
  
  plot((arange(100)/18))
  gca().set_autoscale_on(False)
  connect('button_press_event',click)
  annotate('Line Of Disadvantage', xy=(20, 1), xytext=(7, 3),
              arrowprops=dict(facecolor='black', shrink=0.05))
  annotate('Most Disadvantaged',xy=(20, 1), xytext=(5, 5)),
  annotate('Least Disadvantaged',xy=(20, 1), xytext=(70, 1)),
  
  show()
  </code></pre>