Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when plotting output signal from s.integrate_in_range() #996

Closed
magnunor opened this issue May 14, 2016 · 2 comments · Fixed by #2631
Closed

Error when plotting output signal from s.integrate_in_range() #996

magnunor opened this issue May 14, 2016 · 2 comments · Fixed by #2631
Milestone

Comments

@magnunor
Copy link
Contributor

In the current master, running:

s = hs.signals.Signal(np.arange(1000).reshape(100,10))
s_i = s.integrate_in_range()
# Select some area
s_i.plot()

Gives the error:

<ipython-input-21-d328d94f2a72> in <module>()
----> 1 s_i.plot()

/home/magnunor/Documents/hyperspy/development/hyperspy/signal.py in plot(self, navigator, axes_manager, **kwargs)
   3342 
   3343         self._plot.plot(**kwargs)
-> 3344         self.events.data_changed.connect(self.update_plot, [])
   3345         if self._plot.signal_plot:
   3346             self._plot.signal_plot.events.closed.connect(

/home/magnunor/Documents/hyperspy/development/hyperspy/events.py in connect(self, function, kwargs)
    307         if function in self.connected:
    308             raise ValueError("Function %s already connected to %s." %
--> 309                              (function, self))
    310         if kwargs == 'auto':
    311             spec = inspect.signature(function)

ValueError: Function <bound method Signal.update_plot of <Signal, title: , dimensions: (10|)>> already connected to <hyperspy.events.Event: Event that triggers when the data has changed: {<bound method Signal.update_plot of <Signal, title: , dimensions: (10|)>>}>

The plot still appears, but the Error message is not so nice.

@francisco-dlp francisco-dlp added this to the 1.0.0 milestone May 15, 2016
@francisco-dlp francisco-dlp modified the milestones: 1.0.0, RELEASE_next_patch Jul 13, 2016
@francisco-dlp francisco-dlp removed this from the RELEASE_next_patch milestone Jul 18, 2016
@thomasaarholt
Copy link
Contributor

I keep getting this error on Mac as well, very often when doing things with plots of convoluted models.

@ericpre
Copy link
Member

ericpre commented Jan 29, 2021

Fixed in #2631.

@ericpre ericpre added this to the v1.6.2 milestone Feb 5, 2021
@ericpre ericpre closed this as completed Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants