Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Autogenerate (via boilerplate) more of pyplot.#10934

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
phobson merged 1 commit intomatplotlib:masterfromanntzer:more-autogen
May 4, 2018

Conversation

anntzer
Copy link
Contributor

PR Summary

... namelyaxis,minorticks_{on,off},title,{x,y}lim,{x,y}scale, andsci.

This helps maintaining the signatures (cf.title) and docstring (cf.axis) in sync.

PR Checklist

  • 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

@anntzeranntzer added this to thev3.0 milestoneApr 1, 2018
"""
Display minor ticks on the axes.

Displaying minor ticks reduces performance; turn them off using
Copy link
Member

Choose a reason for hiding this comment

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

Is this really significant? If so, this is an implementation detail.

I would put it in a Note, and formulate a bit more defensive: "Displaying minor ticks may reduce performance. You may turn them off using ...`.

@@ -1601,7 +1601,8 @@ def apply_aspect(self, position=None):
self.set_xbound((x0, x1))

def axis(self, *v, **kwargs):
"""Set axis properties.
"""
Convenience method to get or set some axis properties.

Valid signatures::
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 now use the term "Call signatures".


This image will be the target of colormap functions like
`~matplotlib.pyplot.viridis`, and other functions such as
`~matplotlib.pyplot.hot` or `~matplotlib.pyplot.clim`. The current
Copy link
Member

Choose a reason for hiding this comment

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

remove "hot". It's a cmap like viridis.

@anntzer
Copy link
ContributorAuthor

comments handled

changing dimensions of the plot box.
'tight' Set limits such that all data is shown; if this is already
the case, move data to the center of the figure without
modifying ``xmax-xmin`` or ``ymax-ymin``.
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand; what is an example of the second case, where the limits are changed without changing their differences?

Copy link
Member

@timhoffmtimhoffmApr 4, 2018
edited
Loading

Choose a reason for hiding this comment

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

Indeed the description seems to be incorrect.

>>> fig, ax = plt.subplots()>>> ax.plot([1,3,2])>>> ax.get_xlim()(-0.1, 2.1)>>> ax.set_xlim(right=4.1)(-0.1, 4.1)>>> ax.axis('tight')(-0.1, 2.1, 0.9, 3.1)>>> ax.get_xlim()(-0.1, 2.1)

From the description I would have anticipated(-1.1, 3.1). Anyway, the implemented behavior seems more reasonable. I don't see why 'tight' should preservexmax-xmin. So the docstring should be changed.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Well, I just copied the pyplot docstring :-) Removed the offending sentence, although now it's unclear how this is different from "auto".

As a side note (but not changed by this PR), the docstring of autoscale() states that

        tight: bool or None, optional            If True, set view limits to data limits;            if False, let the locator and margins expand the view limits;            if None, use tight scaling if the only artist is an image,            otherwise treat *tight* as False.            The *tight* setting is retained for future autoscaling            until it is explicitly changed.

implying thatautoscale=True ignores margins. But either that's not true, oraxis('tight') has a different meaning per@timhoffm's example. Note also the docstring ofautoscale_view:

        If *tight* is *False*, the axis major locator will be used        to expand the view limits if rcParams['axes.autolimit_mode']        is 'round_numbers'.  Note that any margins that are in effect        will be applied first, regardless of whether *tight* is        *True* or *False*.  Specifying *tight* as *True* or *False*        saves the setting as a private attribute of the Axes; specifying        it as *None* (the default) applies the previously saved value.

so istight=False basically redundant with the axes.autolimit_mode rc? All that's very confusing...

@anntzer
Copy link
ContributorAuthor

rebased

@phobsonphobson merged commite4ce92f intomatplotlib:masterMay 4, 2018
@anntzeranntzer deleted the more-autogen branchMay 4, 2018 17:12
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@efiringefiringefiring left review comments

@timhoffmtimhoffmtimhoffm approved these changes

@jklymakjklymakjklymak approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.0.0
Development

Successfully merging this pull request may close these issues.

5 participants
@anntzer@efiring@jklymak@timhoffm@phobson

[8]ページ先頭

©2009-2025 Movatter.jp