-
Notifications
You must be signed in to change notification settings - Fork 5
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
Remove hard dependency on ipywidgets and make SVG figures #9
Conversation
src/plopp/io.py
Outdated
from io import BytesIO | ||
|
||
|
||
def fig_to_pngbytes(fig, form='png'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def fig_to_pngbytes(fig, form='png'): | |
def fig_to_bytes(fig, form='png'): |
?
src/plopp/io.py
Outdated
|
||
def fig_to_pngbytes(fig, form='png'): | ||
""" | ||
Convert a Matplotlib figure to png bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs update?
src/plopp/static.py
Outdated
""" | ||
return { | ||
'text/plain': 'Figure', | ||
'image/svg+xml': fig_to_pngbytes(self._fig, form='svg').decode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the size of 2d figures manageable? I expect an svg is much larger than png in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is, but now we rasterize
the pcolormesh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaning... the mesh is not vector, but all the rest is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's how I understand it, but maybe you can check on your display? since the difference between svg and png is not that huge on my monitor
_repr_mimebundle_
home
orlogx
on the toolbar or the figure and they will update each other