- #1
- 970
- 670
- TL;DR Summary
- I'm trying to update a plotly graph with new data:
f1.update_traces(y=[4,3,2,1])
Nothing happens.
After making a graph using Plotly in Python, I'd like to change the data. From the documentation (which is not very clear) it appears this is the code we need:
f1.update_traces( y=[4,3,2,1] )
(where f1 is the figure created previously).
But nothing happens when I run this.
In order to see the new data, I find that I need to do f1.show() after the above step. The problem with this is that it shows a new plot rather than changing the old one, so each time I change the data it goes into a new plot.
So I guess my big-picture question is, using Python in Google Colab, how can I change attributes (including data) of an existing plot in situ?
f1.update_traces( y=[4,3,2,1] )
(where f1 is the figure created previously).
But nothing happens when I run this.
In order to see the new data, I find that I need to do f1.show() after the above step. The problem with this is that it shows a new plot rather than changing the old one, so each time I change the data it goes into a new plot.
So I guess my big-picture question is, using Python in Google Colab, how can I change attributes (including data) of an existing plot in situ?