如何导出/保存用plotly制作的动画气泡图? [英] How to export/save an animated bubble chart made with plotly?

查看:615
本文介绍了如何导出/保存用plotly制作的动画气泡图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何导出/保存用plotly制作的动画气泡图? (例如,一个是通过下面的链接制作的)。我希望将它以礼物或某种格式的分辨率更高。

How to export/save an animated bubble chart made with plotly? (For instance, the one was made following the link below) I would like to have it in a gift or some format with better resolution. Thank you in advance.

https://www.kaggle.com/aashita/guide-to-animated-bubble-charts-using-plotly

推荐答案

不可能通过密谋进行此操作。请使用 givemaker 并将动画中的每个步骤另存为一张图片,以便以后将它们组合为gif。 遵循此来源。在此处中提供了有关如何制作动画的进一步说明。

There is no possibility to do this in plotly. Please use givemaker and save every step in the animation as a single picture to later combine them to a gif. Follow this source. Further explanation on how to create animations is provided by plotly here.

基本方法是将此逻辑集成到您的绘图代码的动画处理中:

The basic way to go would be to integrate this logic into the animation process of your plotly code:

 import ImageSequence
 import Image
 import gifmaker
 sequence = []

 im = Image.open(....)

 # im is your original image
 frames = [frame.copy() for frame in ImageSequence.Iterator(im)]

 # write GIF animation
 fp = open("out.gif", "wb")
 gifmaker.makedelta(fp, frames)
 fp.close()

如果您可以提供实际的代码,则可以为您的问题提供更详细的答案。 :)

If you could provide your actual code, it would be possible to provide a more detailled answer to your question. :)

这篇关于如何导出/保存用plotly制作的动画气泡图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆