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

Make figure images not blurry in docs #58

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Conversation

nvaytet
Copy link
Member

@nvaytet nvaytet commented Oct 27, 2022

Left: after, Right: before
Screenshot at 2022-10-27 10-06-48

@nvaytet nvaytet requested a review from jl-wynen October 27, 2022 08:09
width=width * dpi,
height=height * dpi,
format='png')
return Image(value=fig_to_bytes(self.fig), format='png')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this affecting interactive plots with widgets?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't. Those are screenshots from the docs. By default, we just have svg figures in the docs.
However, when a notebook requires the %matplotlib widget backend to work (if a user downloads the notebook for example), the interactive figure won't render alongside the other widgets in sphinx.

We therefore have to convert it to a widget image, and place that in the widget containers. See here for example.

@nvaytet nvaytet merged commit 5f3f264 into main Oct 27, 2022
@nvaytet nvaytet deleted the better_image_figs_in_docs branch October 27, 2022 08:41
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

Successfully merging this pull request may close these issues.

2 participants