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

DOCS: describe shared axes behavior with units#18353

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
jklymak merged 2 commits intomatplotlib:masterfroml-johnston:issue_18345
Sep 8, 2020
Merged

DOCS: describe shared axes behavior with units#18353

jklymak merged 2 commits intomatplotlib:masterfroml-johnston:issue_18345
Sep 8, 2020

Conversation

l-johnston
Copy link
Contributor

@l-johnstonl-johnston commentedAug 25, 2020
edited
Loading

PR Summary

Closes#18345

PR Checklist

  • [N/A] Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (runflake8 on changed files to check).
  • [N/A] New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • Conforms to Matplotlib style conventions (installflake8-docstrings andpydocstyle<4 and runflake8 --docstring-convention=all).
  • [N/A] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).

@l-johnston
Copy link
ContributorAuthor

I attempted to create an example showing the behavior ofset_units when shared axes have units, but there are many problems.

  1. The units examples rely onTaggedValue defined in basic_units.py.TaggedValue is a container based on numpy's dispatch mechanism where__array__ returns the underlying data as a base classndarray - no more units. This breaks plotting functions likeplot that, very early in execution, callscbook._check_1d that callsnp.atleast1d that calls__array__. Subsequent call toset_units then fails because the data, nowndarray has no units converter.
  2. Plotting functions likebar andscatter don't assign a 'units' callback, so the call toAxis.set_units does nothing. Unlikeplot that does set a 'units' callback.
  3. I can changeTaggedValue.__array__ to return an array ofTaggedValue objects, but this breaks the ellipse example.

@l-johnston
Copy link
ContributorAuthor

@jklymak Is this proposed PR sufficient? Creating an example using the existing basic_units definition isn't going to work as discussed above. I read the unitsdiscourse and see that units has a rather long history. Is there any work on defining an interface layer between incoming data and plot function internals?

Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

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

Seems right? Are there other places wheresharex/y are documented?

Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

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

@l-johnston This is good enough. We don't need an example.

Could you please also update the docstring ofGridSpecBase.subplots() with the same paragraph.

@l-johnstonl-johnston marked this pull request as ready for reviewSeptember 8, 2020 13:07
@jklymakjklymak merged commite26d497 intomatplotlib:masterSep 8, 2020
@l-johnstonl-johnston deleted the issue_18345 branchSeptember 8, 2020 17:42
@QuLogicQuLogic added this to thev3.4.0 milestoneSep 8, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.4.0
Development

Successfully merging this pull request may close these issues.

Specify what sharex and sharey do...
5 participants
@l-johnston@jklymak@timhoffm@QuLogic@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp