I am trying to learn Python in several environments. I can't figure out why this script, provided by armatita works perfectly in CodeRunner for Mac, but does not provide touch functions in Anaconda/Spyder or Pythonista for iOS. Is there something I can do to make in work for all three?
import matplotlib.pyplot as plt
def onclick(event):
print(event.xdata, event.ydata)
fig,ax = plt.subplots()
ax.plot(range(10))
fig.canvas.mpl_connect('button_press_event', onclick)
plt.show()