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

fix(docs): Add screenshot of cross-validation plot #634

Conversation

augustebaum
Copy link
Contributor

This is a quick fix to address #594.

In the end, I took a screenshot manually (by using the "Download plot as png" button of the Plotly widget) and displayed it with matplotlib.

Here are all the alternatives I considered, and what didn't work with them:

  • Use SVG instead of PNG
  • Export plotly figure to a file during the example and read it
    • For that I also need Plotly's fig.write_image
  • Use Pillow for displaying, instead of matplotlib (which is not really made for that)
    • Only matplotlib is supported by sphinx-gallery, the library that renders the examples

Copy link
Contributor

@MarieS-WiMLDS MarieS-WiMLDS left a comment

Choose a reason for hiding this comment

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

A tiny change, otherwise all good for me, it's much prettier, thanks Auguste!

examples/plot_03_cross_validate.py Outdated Show resolved Hide resolved
@augustebaum augustebaum force-pushed the 594-docs-in-the-skore-cross-validation-example-the-plotly-graph-is-not-full-size-in-the-rendering branch from 329bb52 to b48f907 Compare October 29, 2024 11:29
@augustebaum augustebaum force-pushed the 594-docs-in-the-skore-cross-validation-example-the-plotly-graph-is-not-full-size-in-the-rendering branch from f918ee9 to 834b724 Compare October 29, 2024 14:01
This is a quick fix to address #594.

In the end, I took a screenshot manually (by using the "Download plot as png" button of the Plotly widget) and displayed it with matplotlib.

Here are all the alternatives I considered, and what didn't work with them:
- Use SVG instead of PNG
	- For that, I'd need to use Plotly's `fig.write_image`, and the library that Plotly uses for this, Kaleido, is currently broken: plotly/Kaleido#210
- Export plotly figure to a file during the example and read it
	- For that I also need Plotly's `fig.write_image`
- Use Pillow for displaying, instead of matplotlib (which is not really made for that)
	- Only matplotlib is supported by sphinx-gallery, the library that renders the examples
@augustebaum augustebaum force-pushed the 594-docs-in-the-skore-cross-validation-example-the-plotly-graph-is-not-full-size-in-the-rendering branch from 834b724 to e170737 Compare October 29, 2024 14:01
@augustebaum augustebaum merged commit a29d842 into main Oct 29, 2024
5 checks passed
@augustebaum augustebaum deleted the 594-docs-in-the-skore-cross-validation-example-the-plotly-graph-is-not-full-size-in-the-rendering branch October 29, 2024 14:03
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.

fix(docs): In the skore cross validation example, the plotly graph is not full size in the rendering
2 participants