FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

DOC: Remove pyplot vs. OO interface discussion from lifecycle example by timhoffm · Pull Request #31423 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
29 changes: 0 additions & 29 deletions galleries/tutorials/lifecycle.py
This file contains hidden or 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
Expand Up @@ -19,35 +19,6 @@
<https://pbpython.com/effective-matplotlib.html>`_
by Chris Moffitt. It was transformed into this tutorial by Chris Holdgraf.

A note on the explicit vs. implicit interfaces

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we link to the quick start guide here as a way to guide users back to the rest of the docs?

https://matplotlib.org/stable/users/explain/quick_start.html

timhoffm Mar 29, 2026 •
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What makes this example special that warrants referencing the quick start guide?

The pyplot vs. OO was just here because the blog post from which the example was created was a general
https://pbpython.com/effective-matplotlib.html. But in the context of our own docs, we don't need to reference everything back to quick start. Instead, we assume that a user has the basic understanding from quickstart already.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It's written as a self-contained doc, so maintaining a bit of context via links seems useful. Crosslinking never hurts and we could do more of it

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm of a different opinion here. Examples and tutorials in our docs can and should never be self-contained. You cannot jump into an arbitrary place of the docs and expect to understand it without prior knowledge.

Cross-linking hurts if the topic is not directly relevant to the content at hand because it dillutes focus and creates clutter.

Since we obviously have different opinions, I recuse myself from the topic, as such discusions typically lead nowhere. I leave it up to you guys to fix the lifecycle tutorial.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Sure fair enough, but I apologize if it seemed I was demanding this - it was just a suggestion, and you asked why I was making it, so I answered.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Examples and tutorials in our docs can and should never be self-contained.

I think that's a part of a larger discussion on modality and purpose. I also agree w/ @jklymak that a cross-reference is nice to have (here mostly to keep the spirit of the original) but I think removing this is a plus 'cause seperatly I think it's a bad idea to explain things twice cause that introduces the potential for drift.

==============================================

Matplotlib has two interfaces. For an explanation of the trade-offs between the
explicit and implicit interfaces see :ref:`api_interfaces`.

In the explicit object-oriented (OO) interface we directly utilize instances of
:class:`axes.Axes` to build up the visualization in an instance of
:class:`figure.Figure`. In the implicit interface, inspired by and modeled on
MATLAB, we use a global state-based interface which is encapsulated in the
:mod:`.pyplot` module to plot to the "current Axes". See the :ref:`pyplot
tutorials <pyplot_tutorial>` for a more in-depth look at the
pyplot interface.

Most of the terms are straightforward but the main thing to remember
is that:

* The `.Figure` is the final image, and may contain one or more `~.axes.Axes`.
* The `~.axes.Axes` represents an individual plot (not to be confused with
`~.axis.Axis`, which refers to the x-, y-, or z-axis of a plot).

We call methods that do the plotting directly from the Axes, which gives
us much more flexibility and power in customizing our plot.

.. note::

In general, use the explicit interface over the implicit pyplot interface
for plotting.

Our data
========

Expand Down
Loading

Back | FazBrowse Home | New Git URL