glotzerlab / plato

Efficient visualization of particle data supporting several rendering engines.
https://plato-draw.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
12 stars 4 forks source link

Enable specifying mpl figure when saving #57

Closed thomasaarholt closed 4 years ago

thomasaarholt commented 4 years ago

Hiya, and thanks for making this - I tried a lot of different 3D drawing packages before I settled on plato!

I'm currently using plato to generate a lot of views of a material crystal (like a molecule, but for metals and similar - basically lots of atoms). I needed something that could save the visualisation into a movie. What I'm doing is saving lots of individual frames using matplotlib, and then using ffmpeg to stitch it together. It's working nicely.

I'm using plato in jupyter notebook, and there any call to plt.figure() generates a figure in the notebook output. So when I generate 250 images, the notebook displays this. It actually handles it surprisingly well, but I thought it would be better to nip this in the bud before I try braving something with several thousand images.

So here I give the option to let the user reuse a certain figure.

klarh commented 4 years ago

Hi @thomasaarholt, thanks for the contribution! This change looks totally fine; do you have any particular way you'd like to be cited in the changelog? I would default to thomasaarholt@github, but if you'd prefer your university, let me know; I plan on adding locations for all the contributors to the changelog soon after adding your entry just to help disambiguate.

thomasaarholt commented 4 years ago

How nice, sure! I'm at the University of Norway, Oslo. Feel free to add that however you prefer it formatted!