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

Improve matplotlib.axes documentation by timhoffm · Pull Request #24769 · matplotlib/matplotlib · GitHub

Repository navigation

Improve matplotlib.axes documentation - #24769

Merged
tacaswell merged 1 commit into
matplotlib:mainfrom
timhoffm:doc-axes-class
Dec 22, 2022
Merged

tacaswell merged 1 commit into
matplotlib:mainfrom
timhoffm:doc-axes-class

Conversation

Copy link
Copy Markdown
Member
  • Move the Axes class documentation to a sub-page. The constructor is quite lengthy and not needed by most users.
  • Add an introductory sentence to set the context for the subsequent listing and structure of the Axes methods.

Note: I've removed the inheritance diagram, because it does not contain much relevant information.
The inheritance from _AxesBase is shown in the class docstring as well (and is not of much use since the private _AxesBase does not have generated documentation. The only additional information is that it originally inherits from Artist, which I've now included as a sentence in the docstring.

timhoffm added this to the v3.7.0 milestone Dec 19, 2022

story645 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.

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

I like the idea of this change but am being nit picky about wording 'cause this is sort of one of the most conceptually important things to grok. Maybe embed the anatomy figure if it's now its own page?

Comment thread lib/matplotlib/axes/_axes.py Outdated
class Axes(_AxesBase):
"""
The `Axes` contains most of the figure elements: `~.axis.Axis`,
The Axes class represents one (sub-)plot in a figure.

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

I get the the original wording is a problem because a figure can contain multiple Axes, but I think represents is the wrong word here too since that implies some sort of abstraction but modifying an axes object modifies the corresponding plot.

It's something like "An Axes object encapsulates all the elements of an individual (sub-plot) in a figure" but we're sorta inconsistent about using plot to refer to the axes and everything it contains or to the semantic elements within the plot (plot types gallery)

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

Changed to your suggestion. This is mainly a structural PR. The goal is to declutter https://matplotlib.org/devdocs/api/axes_api.html#module-matplotlib.axes so that it does not start with two screens full of unhelpful Axes constructor documentation.

There's still lots of room for content improvement. But I would like to defer this to another PR. IMHO the Anatomy figure has too much detail for the Axes context. I would like a "Parts of a figure" reference page that defines our terminology. This is part of the bigger discussion about kinds of documentation. A tutorial is not a reference point for such reference documentation. This is beyond

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

I would like a "Parts of a figure" reference page that defines our terminology.

Agree that would be awesome

Comment thread lib/matplotlib/axes/_axes.py Outdated

j1642 left a comment

Copy link
Copy Markdown
Contributor

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

Should "plotted data" and "axis ticks" be separate?

Comment thread doc/api/axes_api.rst Outdated

QuLogic commented Dec 21, 2022

Copy link
Copy Markdown
Member

This has caused many duplicate entries, perhaps too much for GitHub to display.

Comment thread doc/api/axes_api.rst
- Move the Axes class documentation to a sub-page.
  The constructor is quite lengthy and not needed by
  most users.
- Add an introductory sentence to set the context for the
  subsequent listing and structure of the Axes methods.

Note: I've removed the inheritance diagram, because it
does not contain much relevant information.
The inheritance from _AxesBase is shown in the class
docstring as well. The only additional information is
that it originally inherits from Artist, which I've
now included as a sentence in the docstring.

Co-authored-by: hannah <story645@gmail.com>
Co-authored-by: j1642 <60148902+j1642@users.noreply.github.com>
tacaswell merged commit ddf33db into matplotlib:main Dec 22, 2022
timhoffm deleted the doc-axes-class branch December 22, 2022 19:29
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
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.

5 participants


Back | FazBrowse Home | New Git URL