-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Reset figure DPI before each example (#1096)
I followed the [sphinx-gallery docs](https://sphinx-gallery.github.io/stable/advanced.html#resetting-before-each-example). I tried to place `reset_mpl` in a different module in the hopes of removing the warning about sphinx not being able to cache `sphinx_gallery_conf`, but I couldn't manage to make the import work. I noticed sklearn declares a function in `conf.py` as well so I don't think it's too big a deal. Closes #675
- Loading branch information
1 parent
947eee5
commit ad34c2d
Showing
3 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,14 @@ | |
"../examples/model_evaluation/plot_cross_validate", | ||
] | ||
|
||
|
||
# https://sphinx-gallery.github.io/stable/advanced.html#resetting-before-each-example | ||
def reset_mpl(gallery_conf, fname): | ||
import matplotlib | ||
|
||
matplotlib.rcParams["figure.dpi"] = 200 | ||
|
||
|
||
# sphinx_gallery options | ||
sphinx_gallery_conf = { | ||
"examples_dirs": "../examples", # path to example scripts | ||
|
@@ -79,6 +87,7 @@ | |
"backreferences_dir": "generated", | ||
"doc_module": "skore", | ||
"default_thumb_file": "./_static/images/[email protected]", | ||
"reset_modules": (reset_mpl, "seaborn"), | ||
} | ||
|
||
# intersphinx configuration | ||
|