Skip to content

add subplots to axes documentation #11454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2018

Conversation

fredrik-1
Copy link
Contributor

Added the _subplots module to the axes documentation. Changed subplot_class_factory docstring to a docstring and put :nosignatures: in the figure_api.rst file because I think it looks nicer.

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@fredrik-1 fredrik-1 force-pushed the doc_rendering_subplots branch from 37ff66d to 3f0533f Compare June 18, 2018 14:28

.. contents:: Table of Contents
:depth: 2
:local:
:backlinks: entry
:class: multicol-toc

Subplots
Copy link
Member

@jklymak jklymak Jun 18, 2018

Choose a reason for hiding this comment

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

This appears in the TOC as a level above "Plotting", so I think needs a lower decoration level:

https://10464-1385122-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/api/axes_api.html

Copy link
Contributor Author

@fredrik-1 fredrik-1 Jun 18, 2018

Choose a reason for hiding this comment

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

I tried to change the header hierarchy without checking the result... and I see now that didn't work and that I didn't know how headers works in rst. I tried to lower the subplot level and that level stayed the same but everything else toggled its level... Tries again.

edit: I thought I pushed a new version yesterday but something went wrong. It should be updated now.

Copy link
Member

@timhoffm timhoffm Jun 18, 2018

Choose a reason for hiding this comment

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

I don't think this is going the right way. This whole page was documenting the Axes class. You've now changed it to the axes module and inserted the subplots stuff in between the class description and the list of functions (the sections here are used to group the Axes methods by topic).

It may be ok to document the complete axes module here, but then one would have to change the structure. The TOC is currently "within the class" and only listing its functions.

It would have to go to the top and be restructured to something like:

  • Axes
    • Plotting
    • ...
  • Subplots

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But why should there be a special page for documenting the Axes class instead of the axes module?

But the page can of course be restructured in same way.

Copy link
Member

Choose a reason for hiding this comment

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

The Axes class is so large and fundamental, that it might have a dedicated page. But I'm not saying it has to be that way. I also laid out a possible structure if the file should contain the whole module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure what is the best. Your structure is of course a possibility (it was not in your post when I wrote my answer).

I am thinking that axes is one module, it consist of 2 public classes and a factory function. Most axes used in practice are also subplots. The suggest structure show the 2 classes and the factory function at the beginning in a way that don't take up to much place and I doubt that the order is confusing.

What about changing the name to subplot sub module or something like that?

One problem is that the axes module is not included in the module list in neither version of the documents.

@fredrik-1 fredrik-1 force-pushed the doc_rendering_subplots branch from 3f0533f to 656e86e Compare June 18, 2018 18:17
@tacaswell tacaswell added this to the v3.0 milestone Jun 18, 2018
@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jun 18, 2018
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

I’m approving as is. Having the subplots module where it is is a bit jarring, but at least its now appearing in the docs, which it wasn’t before. We can make further changes if we hate it (maybe move to the bottom)

@jklymak jklymak merged commit 2b51fa3 into matplotlib:master Jun 21, 2018
@fredrik-1 fredrik-1 deleted the doc_rendering_subplots branch June 23, 2018 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants