Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed as not planned
Labels
Milestone
Description
Hi, I have:
- notebook 4.2.1
- matplotlib 1.5.1
- Python 3.5.2
- running on Ubuntu
I setup my env through conda.
An example from the docs that uses mpl_connect:http://matplotlib.org/users/event_handling.html#event-attributes
from matplotlib import pyplot as pltclass LineBuilder: def __init__(self, line): self.line = line self.xs = list(line.get_xdata()) self.ys = list(line.get_ydata()) self.cid = line.figure.canvas.mpl_connect('button_press_event', self) def __call__(self, event): print('click', event) if event.inaxes!=self.line.axes: return self.xs.append(event.xdata) self.ys.append(event.ydata) self.line.set_data(self.xs, self.ys) self.line.figure.canvas.draw()fig = plt.figure()ax = fig.add_subplot(111)ax.set_title('click to build line segments')line, = ax.plot([0], [0]) # empty linelinebuilder = LineBuilder(line)plt.show()
Theprint('click', event)
line does not show any output in my Jupyter notebooks.