Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update Axes docs on aspect-related methods #9964

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
Dec 12, 2017

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Dec 9, 2017

PR Summary

This PR contains updated docstrings on

  • Axes.set_aspect()
  • Axes.apply_aspect()
  • Axes.set_adjustable()
  • Axes.set_anchor()
  • Axes.get_anchor()

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.

This looks very helpful. A few suggestions!

'datalim' change xlim or ylim
'box-forced' same as 'box', but axes can be shared
============ =====================================
Set the aspect of the axis scaling, i.e. the ratio of y-unit to x-unit.
Copy link
Member

Choose a reason for hiding this comment

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

axis->Axes ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's really the ratio of y-axis-scaling to x-axis-scaling, not the aspect of the Axes bounding box.

value description
======== ================================================
'auto' automatic; fill position rectangle with data
'equal' same scaling from data to plot units for x and y
Copy link
Member

Choose a reason for hiding this comment

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

scaling from data to Axes co-ordinates the same for the x and y

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the original description, which I've not modified. I think both versions are not exactly helpful to the point for different reasons.

Overall, I think we would need a dedicated help page to explain, coordinates, scaling and the related terminology, which is not always consistent and/or self-explanatory.

I prefer to leave it like this for the moment.

======== ================================================
'auto' automatic; fill position rectangle with data
'equal' same scaling from data to plot units for x and y
num a circle will be stretched such that the height
Copy link
Member

Choose a reason for hiding this comment

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

scaling from data to Axes co-orindates of y dimensions is num times the x dimension. a circle will...

Copy link
Member Author

Choose a reason for hiding this comment

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

See above.

===== =====================
See Also
--------
matplotlib.axes.Axes.set_adjustable
Copy link
Member

Choose a reason for hiding this comment

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

Do these need to be made as links?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! Deleting comments below just to keep things clean...

Adjust the axes so that it fulfills its aspect setting.

Depending on `.get_adjustable` and `.get_anchor` this will either modify
they axes box or the view limits.
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" (I think we capitalize Axes, maybe incorrect, but I think it makes sense since its not the plural of axis here?)

Copy link
Member

Choose a reason for hiding this comment

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

We capitalize Axes because it's a Python class and that's PEP8 style. We don't capitalize axes if it's not referring to the class/an instance.

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 we are referring to an instance here...

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed this and a few other cases in the above functions.

Note that the distinction is by far not always made in the code. Speaking just of _AxesBase, maybe 2/3 the cases use "axes" where it should be "Axes" according to your rules. IMO this distinction is not too important in many cases, unless you want a strong connotation to the class-type, in which case you would use the reference `Axes` anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I only suggest it because of the linguistic strangeness of referring to "axes" as singular, so at least if we use "Axes" we can say its a singular proper noun.

@jklymak jklymak merged commit 542f7e6 into matplotlib:master Dec 12, 2017
@jklymak
Copy link
Member

jklymak commented Dec 12, 2017

Thanks a lot @timhoffm !

@timhoffm timhoffm deleted the doc-axes-aspect branch December 12, 2017 20:38
@QuLogic QuLogic added this to the v2.2.0 milestone Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.