AttributeError when producing an Interactive plot
See original GitHub issuePlotly 4.1.0
I get an error when I try to run @jonmmease 's Interact notebook:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/opt/anaconda3/lib/python3.7/site-packages/ipywidgets/widgets/interaction.py in update(self, *args)
254 value = widget.get_interact_value()
255 self.kwargs[widget._kwarg] = value
--> 256 self.result = self.f(**self.kwargs)
257 show_inline_matplotlib_plots()
258 if self.auto_display and self.result is not None:
<ipython-input-27-8163515321f0> in update(a, b, color)
4 def update(a=3.6, b=4.3, color='blue'):
5 with fig.batch_update():
----> 6 scatt.x=xs
7 scatt.y=np.sin(a*xs-b)
8 scatt.line.color=color
/opt/anaconda3/lib/python3.7/site-packages/plotly/basedatatypes.py in __setattr__(self, prop, value)
349 else:
350 # Raise error on unknown public properties
--> 351 raise AttributeError(prop)
352
353 def __getitem__(self, prop):
AttributeError: x
I get the same error wen I run the notebook with Binder.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
I am getting error in plotly module of FB prophet - Stack Overflow
I am getting the following error when executing the below code: Code: from fbprophet.plot import plot_plotly ...
Read more >AttributeError when creating pyqtgraph plots inside the main ...
I am trying to read some data from a file and plot it using pyqtgraph (as given in the code below). All the...
Read more >Sage Interactive has Attribute error - Ask Sagemath
Herr is my code for a double integrator interactive I am making that both make a double integral and shows a graph with...
Read more >Matplotlib pane throwing AttributeError when interactive=True
It throws an AttributeError as get_ipython() returns None instead of an ... ax = plt.subplots() ax.plot([0,1,2], [2,2,4]) pn.pane.plot.
Read more >Connection between google colab and Anvil is not working
Hi, I would like to show some interactive plots that I have saved as HTML ... AttributeError: module 'anvil' has no attribute 'LiveObject'....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, that’s good feedback, thanks!
For reference, the change in behaviour was documented in the version 4 migration guide here: https://plot.ly/python/v4-migration/#add-trace-return-value along with a suggested workaround for adapting older code like the notebook you were initially working from.
@sursu Yes, you are right. Just don’t rename fig.data[0] and replace the above scatt updates as follows:
Please address such questions on Plotly forum https://community.plot.ly/, not here.
Update: I 've just tested the initial @jonmmease’s code on an environment with Plotly 3.0 and it worked. This means that at some point the new plotly upgrades made the code obsolete.