Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Error at save animation with pillow #15678

Closed
@Zachary4biz

Description

@Zachary4biz

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp