Closed HumHongeKamyaab closed 2 years ago
Hi @HumHongeKamyaab
For screenshots from jupyter notebook mode you can use plot.fetch_screenshot() like here
https://github.com/K3D-tools/K3D-jupyter/blob/main/examples/screenshot_generator.ipynb
For execution without jupyter we have headless rendering: https://github.com/K3D-tools/K3D-jupyter/blob/main/examples/headless.ipynb
Best regards, Artur
Hi @artur-trzesiok
Thanks for providing this veryuseful visualization library.
I have a problem when I try to take a single screenshot using the exact same code provided in the documentation here.
After running this line of code:plt.fetch_screenshot()
, the output of plt.screenshot
is empty ''
!!
Do you please have any idea why it didn't work?
Best regards,
Hi Youssef,
this is the old, non-headless screenshot mechanism. For the new mechanism see this example: https://github.com/K3D-tools/K3D-jupyter/blob/main/examples/headless.ipynb
For this example: https://github.com/K3D-tools/K3D-jupyter/blob/main/examples/screenshot_generator.ipynb you need a few things:
fetch_screenshot
or use the generator approach further down in the example.
Thank you Tgandor, It works using the headless screenshot mechanism.
I want to save the figure as a PNG file in particular camera orientation. While we can set camera using
plot.camera
, I couldn't find something likeplot.save
, so that a png image can be saved using a python script, and we don't have to manually select screenshot from the widget to save the image,