Skip to content

Adding index explanation to 'Controlling and Labelling Axis Objects" #25805

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

Closed
wants to merge 19 commits into from

Conversation

mattymo30
Copy link
Contributor

PR summary

Following up on issue #25492, I added an indexed overview of the 'Controlling and Labelling Axis Objects' section of the user's explain page. The overview is a simple explanation of how Axis objects can be controlled and manipulated using the artist class. I also added reference links to the artist class and the examples of axis artist.

This is still a WIP, as I would like to add examples/written tutorials of this module.

PR checklist

mattymo30 and others added 11 commits April 3, 2023 22:12
Wanted to implement a redirect to the examples' page for text, labels, and annotations, similar to the user_explain\colors\README.txt
Wanted to implement a redirect to the examples' page for text, labels, and annotations, similar to the user_explain\colors\README.txt
Some capitalization issues, or capitalizing certain words (TrueType) that is typically capitalized
Need to move/write examples that cover using and modifying axis objects (probably in axisartist module on the examples page)
Fixed reference to axis artist reference page

Need to move/write examples that cover using and modifying axis objects (probably in axisartist module on the examples page)
Fixed reference to axis artist reference page

Need to move/write examples that cover using and modifying axis objects (probably in axisartist module on the examples page)
Fixed reference to axis artist reference page

Need to move/write examples that cover using and modifying axis objects (probably in axisartist module on the examples page)
Need to move/write examples that cover using and modifying axis objects (probably in axisartist module on the examples page)
Need to move/write examples that cover using and modifying axis objects (probably in axisartist module on the examples page)
Need to move/write examples that cover using and modifying axis objects (probably in axisartist module on the examples page)
Comment on lines 6 to 7
Matplotlib `~.axis.Axis` objects can be controlled and manipulated
using the `~.artist.Artist` class. These tutorials cover the basics
Copy link
Member

Choose a reason for hiding this comment

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

My major concern is that this makes it sound like an Artist is a controller class of an Axis, when an Axis is a type of artist.
Maybe table set here for folks who aren't gonna read the doc? Like introduce what is an Axis in Matplotlib's notion of a figure/visualization, summarize/link out to what is an artist, and then make clear that an axis is a type of artist and what that means?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay. That does make more sense. I was still a little confused on the Axis API, so that really help. I'll try to reword it and work on it today or tomorrow (I am currently in my finals week for school so it may be a little delayed). Thank you!

Copy link
Member

Choose a reason for hiding this comment

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

After finals week is fine/this is definitely not more important and good luck!

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 updated the description somewhat, and also added an inheritance diagram (from the Axis API page) to show how it is a type of Artist object. I also added a reference to that page. Let me know if what I wrote is any better and if I should change/add more to it. Thank you!

@story645
Copy link
Member

story645 commented May 2, 2023

While my review is definitely critical, I'm super psyched you're taking the initiative to do this and so very much want to see these docs come into existence. Thanks so much!

Added inheritance diagram to show how it is inherited
Added reference to axis_api page (also added a reference within that page so it can be linked)
@jklymak
Copy link
Member

jklymak commented Jun 15, 2023

I think fixing this is definitely important. But the proposal here simply refers people to the Axis API, which isn't moving things forward a lot. @mattymo30 did you want to work on outlining something more comprehensive and have a go at it? I agree the API is confusing and maddeningly spread between Axis and Axes.

Copy link
Member

@story645 story645 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 it's kinda getting there, but the focus here should be a simple "what is an Axis"
I'd really like something to go in before #26110 because the text there feels very much like a placeholder, but I'm not sure if the timing works.

Comment on lines 13 to 15
Almost every object interacted with on a Matplotlib plot is an "Artist,"
which are a subclass of the `~matplotlib.artist.Artist` class. These objects
help to customize and modify your Matplotlib figures and visualizations.
Copy link
Member

Choose a reason for hiding this comment

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

I think it's enough to say something like an Axis is an artist subclass, for more on manipulating artists see

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the description a little and just moved the link to the artists tutorial in this part

Comment on lines 6 to 8
Matplotlib `~.axis.Axis` objects are a type of Artist that can help
control and modify axes on a Matplotlib figure or visualization, which can
include alignment, direction, style, curve, and more.
Copy link
Member

Choose a reason for hiding this comment

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

I think this is in the right direction, but is sort of lumping the Axis with the Axes in a way where it may not be clear which is which.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it to axis to prevent confusion

@story645
Copy link
Member

Also @mattymo30 sorry that I dropped the ball on getting back to you. Please let us know if you'd like to finish this up.

@mattymo30
Copy link
Contributor Author

Also @mattymo30 sorry that I dropped the ball on getting back to you. Please let us know if you'd like to finish this up.

Sorry for the late reply, I've just been really busy lately. I'd be okay with finishing this up.

@mattymo30 mattymo30 requested a review from story645 June 20, 2023 13:34
@story645 story645 self-assigned this Jun 23, 2023
Comment on lines 6 to 8
Matplotlib `~.axis.Axis` objects are a type of Artist that can help
control and modify axis on a Matplotlib figure or visualization, which can
include alignment, direction, style, curve, and more.
Copy link
Member

Choose a reason for hiding this comment

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

It's more than that - the Axis artists are the underlying abstraction for an axis - basically the don't help control and modify, they are the code stand ins for the axis.

Also split the what it is and the what it controls into two sentences for some breathing room.

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 tried to redefine the axis object to how you explained it to me. Let me know if it needs any more changing or updating

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's a meta problem that it's kinda a problem to use the word axes because it's too easy to confuse plotting axes with mpl Axes.

Comment on lines 6 to 8
Matplotlib `~.axis.Axis` objects are a type of Artist that
are the underlying abstraction and the basis for the axes
on a Matplotlib figure or visualization. Axis objects are
Copy link
Member

Choose a reason for hiding this comment

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

I think something got jumbled - an Axes contains two or more Axis. The Axis are kinda abstractions of the coordinate system. See anatomy of a plot: https://nbviewer.org/github/matplotlib/AnatomyOfMatplotlib/blob/master/AnatomyOfMatplotlib-Part1-Figures_Subplots_and_layouts.ipynb

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 think I'm starting to get really confused on the concept of the axis artist now. I'm really struggling on how to describe it further

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, sorry about that :/ It is confusing, especially cause of the axis/axes thing. I tried to write a short verison at #26205, but what do you think about the explanation in https://matplotlib.org/devdocs/users/explain/quick_start.html#axis-scales-and-ticks

Copy link
Member

Choose a reason for hiding this comment

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

I will re-iterate that I didn't write this section yet because it its very confusing, and indeed I'm strongly considering just dropping it and moving relevant material to Axes. I would not try and do this as a new contributor unless you have a vision for it.

Copy link
Member

Choose a reason for hiding this comment

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

I think I agree with Jody here and therefore I'm sorry Matty if I've made you feel like you're wasting your time. While I totally appreciate how much effort you've been putting in here, I'm thinking maybe your energy might be put to better use elsewhere. Even opening an issue on all the ways you've found this confusing would be helpful as guidance for someone writing the section.

Jody I think regardless of where this PR goes, this should be folded into the Axes section until it gets big and complicated enough to need its own.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the very late reply (I've been extremely busy with another project), but no worries! It was definitely a challenge as a new contributor to try and write this documentation but I understand

Copy link
Member

@story645 story645 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 is much improved! I'm very cool with merging this for now so there's content there and removing some of the urgency on getting the wider set of changes in #26279 in

@story645 story645 added the Documentation: user guide files in galleries/users_explain or doc/users label Jul 18, 2023
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.

@story645 has argued elsewhere that this page should not exist. I agree. So I'm confused why we would add it. Certainly a release should not go out adding a page to just remove it a release later.

@story645
Copy link
Member

Certainly a release should not go out adding a page to just remove it a release later.

Because you marked the other PR release critical and I thought this placeholder could address the "critical b/c empty" issue while we sort through the larger questions around that section. I'd rather one page I'm iffy about go in than a whole bunch of content.

@tacaswell
Copy link
Member

@mattymo30 I think this PR was made redundant by #26279 so I am going to close it. Thank you for your work on this even though we did not take it!

I hope we hear from you again.

@tacaswell tacaswell closed this Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: user guide files in galleries/users_explain or doc/users Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants