rougier/matplotlib-3d

in a jupyter notebook: how to force Mesh display to be a png and not an svg?

r03ert0 opened this issue ยท 1 comments

hello ๐Ÿ‘‹
I'm using matplotlib-3d to display meshes inside a jupyter notebook. The meshes are ~20k vertices, and Mesh() produces very large svg files (my notebooks end up with file sizes on the ~100 MB!). Is there a way of forcing the resulting image to be a png instead of an svg? I know I can save the image as a png using plt.savefig() -- and that works great -- but I'd like somehow to replace the svg in the notebook by that png...
thank you in advance!

I found : )
I'm adding this at the beginning:

from IPython.display import set_matplotlib_formats
set_matplotlib_formats('png')

Now my notebooks are all nice and tiny and with beautiful meshes :)