1

Thanks for help me in advance

I have a gif file say sample.gif what I want to show this GIF file in my .ipynb or without opening new window, I have series of .gif file and I am creating subplots to display gif's and can't find better solution

I see pyglet but it opens new window to display gif. As I have GIF files only so I think there is no code for provide here

Thanks for helping

EDIT : Trying below code gives error : TypeError: Image data of dtype <U10 cannot be converted to float

import matplotlib.pyplot as plt
plt.imshow('sample.gif', cmap='gray')

I found a way to do this using Ipython.display.Image but it do not plots in a subplot it shows all gif one after other in vertical. Can anyone help me on how to apply subplots on Ipython.display.Image

with open('sample.gif','rb') as f:
  display(Image(data=f.read(),format="png",width =150,height=150))
Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
Eshan Agarwal
  • 43
  • 1
  • 5
  • Does this answer your question? [How do I embed a gif in Jupyter notebook?](https://stackoverflow.com/questions/51527868/how-do-i-embed-a-gif-in-jupyter-notebook) – Helios Apr 09 '20 at 16:07
  • Thanks for helping i think it's not what I want, I have a pipeline in which I am reading arrays and convert these arrays in gif and then try to play gif as above so I think doing with code is good not markdown command – Eshan Agarwal Apr 09 '20 at 16:17

0 Answers0