![](/img/trans.png)
[英]Why matplotlib does not show the scatter plot in a second cell of a Jupyter notebook?
[英]matplotlib animation video not fitting in Jupyter_Notebook Cell
好的,所以我嘗試在matplotlib中創建一些動畫。 我正在Jupyter筆記本上進行此操作。
我正在使用to_html5_video()
轉換動畫。 並使用HTML()
顯示它。 問題是該視頻不適合我的手機。
fig, ax = plt.subplots()
l, = ax.plot([],[], "k.")
ax.set_xlim([0,L])
ax.set_ylim([0,L])
def animate(i):
l.set_data(xPos[:i], yPos[:i])
ani = animation.FuncAnimation(fig, animate,frames=len(xPos)).to_html5_video()
HTML(ani)
如何正確安裝?
遇到此問題時,我發現可以通過使用plt.rcParams["savefig.dpi"] = 100
來plt.rcParams["savefig.dpi"] = 100
視頻。 這使我想到我的配置有些糟糕,因此我只刪除了~/.matplotlib/matplotlibrc
,現在可以正確渲染動畫的示例代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.