Skip to content

MAINT: Replace plt.<cmd> pattern with explicit fig/ax calls#295

Merged
bsipocz merged 7 commits intonumpy:mainfrom
rossbar:matplotlib-nopyplot
Feb 12, 2026
Merged

MAINT: Replace plt.<cmd> pattern with explicit fig/ax calls#295
bsipocz merged 7 commits intonumpy:mainfrom
rossbar:matplotlib-nopyplot

Conversation

@rossbar
Copy link
Copy Markdown
Collaborator

@rossbar rossbar commented Nov 26, 2025

My understanding is that explicit figure/axis creation is the recommended pattern for pyplot on the basis of "explicit-over-implicit". Since one of the goals of numpy-tutorials is to highlight best-practices for scientific programming, I figured it'd be worthwhile to attempt to emphasize the OO pattern as opposed to the implicit fig/ax creation from plt.imshow, plt.plot, etc.

I don't have strong feelings though - I'm curious to what degree (if any) mpl folks would view this as an improvement @ksunden.

@rossbar rossbar added maintenance content Issues relevant to tutorial content labels Nov 26, 2025
Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

I think this makes sense, but would be nice to get a thumbs up from a mpl person.

@bsipocz bsipocz merged commit 4e0b558 into numpy:main Feb 12, 2026
9 checks passed
github-actions bot pushed a commit to dumpmemory/numpy-tutorials that referenced this pull request Feb 13, 2026
MAINT: Replace `plt.<cmd>` pattern with explicit fig/ax calls 4e0b558
github-actions bot pushed a commit that referenced this pull request Feb 13, 2026
MAINT: Replace `plt.<cmd>` pattern with explicit fig/ax calls 4e0b558
@rossbar rossbar deleted the matplotlib-nopyplot branch February 13, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content Issues relevant to tutorial content maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants