Created
          March 29, 2018 13:07 
        
      - 
      
- 
        Save ceptreee/a1c4948bd9fba9d4d7520f697951e168 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import numpy as np | |
| import matplotlib.pyplot as plt | |
| def motion(event): | |
| x = event.xdata | |
| y = event.ydata | |
| ln.set_data(x,y) | |
| plt.draw() | |
| plt.figure() | |
| ln, = plt.plot([],[],'x',markersize=10) | |
| plt.connect('motion_notify_event', motion) | |
| plt.show() | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import numpy as np | |
| import matplotlib.pyplot as plt | |
| def motion(event): | |
| x = event.xdata | |
| y = event.ydata | |
| if (x is None) or (y is None): | |
| return | |
| ln.set_data(x,y) | |
| print('(x,y) = (%.2f,%.2f)' % (x,y)) | |
| plt.draw() | |
| plt.figure() | |
| ln, = plt.plot([],[],'x',markersize=10) | |
| plt.xlim([-1,1]) | |
| plt.ylim([-1,1]) | |
| plt.grid() | |
| plt.connect('motion_notify_event', motion) | |
| plt.show() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import numpy as np | |
| import matplotlib.pyplot as plt | |
| def motion(event): | |
| x = event.xdata | |
| y = event.ydata | |
| ln.set_data(x,y) | |
| plt.draw() | |
| plt.figure() | |
| ln, = plt.plot([],[],'x',markersize=10) | |
| plt.connect('motion_notify_event', motion) | |
| plt.show() | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment