Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug report
Bug summary
line 575 ofanimation.py
useImage.frombytes
to load aBytesIO
, this will lead to an exception --not enough image data
.
seems we can't feed bytes of.png
tofrombytes
from the first question-comment ofthis SO question
Code for reproduction
importnumpyasnpfrommatplotlibimportanimationimportmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportAxes3Demb=np.random.random_sample((1000,3))fig=plt.figure("bug_report")ax=Axes3D(fig)ax.set_xlabel('x')ax.set_ylabel('y')ax.set_zlabel('z')ax.set_xlim3d(left=-1,right=1)ax.set_ylim3d(bottom=-1,top=1)ax.set_zlim3d(bottom=-1,top=1)batch=50defanimate(i):emb_part=emb[i*batch:(i+1)*batch]ax.scatter(xs=emb_part[:,0],ys=emb_part[:,1],zs=emb_part[:,2])returnaxani=animation.FuncAnimation(fig=fig,func=animate,frames=len(emb)//batch+1,interval=0.01*1000,blit=False,repeat=False)ani.save("/Users/zac/Downloads/ani.gif",fps=30,writer='pillow')
Actual outcome
# ....ValueError: not enough image dataDuring handling of the above exception, another exception occurred:# ....
actually, if we useplt.show()
beforeani.save
, this exception wont appear, but we will get only some last parts of the animation,example as this
Expected outcome
normally saved gif pic
example as this
Matplotlib version
- Operating system: MacOSX
- Matplotlib version: 3.0.3
- Matplotlib backend (
print(matplotlib.get_backend())
): Qt5Agg - Python version: 3.7.3
- Jupyter version (if applicable):
- Other libraries: numpy