Skip to content

DOC add section on matplotlib usage within the display classes - #34136

Merged
thomasjpfan merged 3 commits into
scikit-learn:mainfrom
AnneBeyer:doc_mpl_and_displays
May 31, 2026
Merged

thomasjpfan merged 3 commits into
scikit-learn:mainfrom
AnneBeyer:doc_mpl_and_displays

Conversation

@AnneBeyer

Copy link
Copy Markdown
Member

Reference Issues/PRs

I gathered this information while working on the displays and thought it could be useful to make it explicit.

What does this implement/fix? Explain your changes.

Adds a section on how matplotlib is imported in the display classes and the corresponding tests, as it is not a required dependency of scikit-learn.

AI usage disclosure

I used AI assistance for:

Any other comments?

@AnneBeyer AnneBeyer mentioned this pull request May 27, 2026
2 of 4 tasks
Comment thread doc/developers/plotting.rst Outdated
dependency for building and using the package (it is only required for building the
docs). Therefore, it is also not imported globally in the display classes, but only
within the plotting functions where it is actually needed. To import it, use
`check_matplotlib_support

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The line number can easily get out of date. An alternative is to reference the file and the function to pay attention to.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That makes sense. Thanks! I updated both sections.

Comment thread doc/developers/plotting.rst Outdated
message including the caller that requested it, for reference.

For testing, use the `pyplot fixture
<https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/conftest.py#L256>`_ as

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here regarding line number being out of date.

@thomasjpfan thomasjpfan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@AnneBeyer AnneBeyer added this to Labs May 29, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Labs May 29, 2026
@AnneBeyer AnneBeyer moved this from Todo to In progress in Labs May 29, 2026
@thomasjpfan
thomasjpfan merged commit 63ff156 into scikit-learn:main May 31, 2026
33 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Labs May 31, 2026
@jeremiedbb jeremiedbb mentioned this pull request Jun 1, 2026
16 tasks done
@AnneBeyer
AnneBeyer deleted the doc_mpl_and_displays branch June 4, 2026 10:48
prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants