Generate .gif from your Plotly figures
BSD-3-CLAUSE License
A simple python package to generate .gif from your plotly figures. It works for both 2D and 3D figures. It can even create_gif motion for you in 3D plots.
pip install plotly-gif
If you are already using plotly, then you should be good. But, just in case, these are the dependencies:
There are three common methods:
Currently, we have the follow:
import plotly.graph_objs as go
from plotly_gif import GIF, two_d_time_series
fig = go.Figure()
# add your traces()
# add your formatting()
gif = GIF()
two_d_time_series(gif, fig)
If you have a function that is changing the `go.Figure' with each loop, you can add the decorator to the func.
import plotly.graph_objs as go
from plotly_gif import GIF, capture
gif = GIF()
@capture(gif)
def plot_(x_, y_):
fig = go.Figure()
# add your traces()
# add your formatting()
return fig
gif.create_gif() # generate gif
This very similar to the decorator option, but you can call the image capture function directly.
import plotly.graph_objs as go
from plotly_gif import GIF, capture
gif = GIF()
def plot_(x_, y_):
fig = go.Figure()
# add your traces()
# add your formatting()
gif.create_image(fig) # create_gif image for gif
return fig
gif.create_gif() # generate gif
See examples folder
pip install kaleido==0.1.0post1