Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mpl_connect does not write output to jupyter notebook #6948

Closed as not planned
Labels
@michalsustr

Description

@michalsustr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp