I am wondering whether plotly supports animation for bar charts in Jupyter.
My purpose is to display a bar chart with several sequences of data. The problem is that first I want to display a bar chart with the first sequence of data, then with 1 second delay, update the first plot with the second sequence of data (remove old data and put new data in the same plot) and so on.
Currently in Jupyter notebook, I clear the the cell output to display the next bar chart. Is there a way with plotly that I can just update the data in a single bar chart without changing the frame or clearing the whole output?
You can update an existing figure in the Jupyter notebook if you create the figure as a FigureWidget (See https://plot.ly/python/widget-app/) . Hereβs an example with a bar chart.
First create the figure with initial data and display it
import plotly.graph_objs as go
data = [go.Bar(
x=['giraffes', 'orangutans', 'monkeys'],
y=[20, 14, 23]
)]
layout = {'yaxis': {'range': [0, 25]}}
fig = go.FigureWidget(data, layout)
fig
i was looking similar sort of i posted my code there in community β¦ and saw it later but unfortunatly it it did not solv emy problme and still looking answer