Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating movie from 3D Arrays #417

Open
deesdeel opened this issue Oct 21, 2022 · 0 comments
Open

Creating movie from 3D Arrays #417

deesdeel opened this issue Oct 21, 2022 · 0 comments

Comments

@deesdeel
Copy link

I have a seemingly very simple task. I have N 3D arrays, and I want to create a movie with N frames out of those arrays.
Step one: Plot a single frame. I accepted this challenge and thought it will be a matter of 10 minutes to find out how to do that with matplotlib. I was wrong, for me it seemed incredibly complicated. Therefore I was very happy when I found the ipyvolume package and its volshow function, that does exactly what I want.. Fast forward three days: Yeah, it could be so easy, if only it would work.. I tried ipyvolume on google colab (where I usually do my Python stuff), in Code, Jupyter Notebooks in Firefox and Chrome, nothing worked.. Now in JupyterLab I finally have some plots shown in my output. Still the control panels partly don't work (Failed to load model class 'HBoxModel' from module '@jupyter-widgets/controls'), but that's okay.. I don't need any fancy JS stuff.. I just want a movie file..
however, even with the example code snippets given on the website new problems arrise:


ValueError Traceback (most recent call last)
~\anaconda3\lib\site-packages\ipyvolume\pylab.py in _screenshot_data(timeout_seconds, output_widget, format, width, height, fig, headless, devmode)
1269 with output_widget:
1270 if timeout and not done[0]:
-> 1271 raise ValueError("timed out, no image data returned")
1272 finally:
1273 with output_widget:

ValueError: timed out, no image data returned


AttributeError Traceback (most recent call last)
~\anaconda3\lib\site-packages\ipyvolume\pylab.py in movie(f, function, fps, frames, endpoint, cmd_template_ffmpeg, cmd_template_gif, gif_loop)
1202 function(fig, i, fraction)
1203 frame_filename = os.path.join(tempdir, "frame-%05d.png" % i)
-> 1204 savefig(frame_filename, output_widget=output)
1205 with output:
1206 if movie_filename.endswith(".gif"):

~\anaconda3\lib\site-packages\ipyvolume\pylab.py in savefig(filename, width, height, fig, timeout_seconds, output_widget, headless, devmode)
1339 with open(filename, "wb") as f:
1340 f.write(
-> 1341 _screenshot_data(
1342 timeout_seconds=timeout_seconds,
1343 output_widget=output_widget,

~\anaconda3\lib\site-packages\ipyvolume\pylab.py in _screenshot_data(timeout_seconds, output_widget, format, width, height, fig, headless, devmode)
1274 fig.on_screenshot(screenshot_handler, remove=True)
1275 data = data[0]
-> 1276 data = data[data.find(",") + 1 :]
1277 return base64.b64decode(data)
1278

AttributeError: 'NoneType' object has no attribute 'find'

I'm sorry for the emotionaly charged post, but this is supposed to be a side project for me and I already wasted my whole week on it.. Can somebody tell me how to get my task done in a simple fashion? I don't care if it's done by using ipyvolume or any other plotting tool.. Thanks people :*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant