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

FIX: make sure all ticks show up for colorbar minor tick#12099

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
tacaswell merged 2 commits intomatplotlib:masterfromjklymak:fix-all-cbar-ticks
Sep 15, 2018

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedSep 11, 2018
edited
Loading

PR Summary

#12095 shows that if you expect a minor colorbar tick right at the end of a colorbar it sometimes doesn't show up due to floating point precision issues. This fixes that...

PR Checklist

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

@jklymak
Copy link
MemberAuthor

Cross-ref#11004

@jklymakjklymak added this to thev3.0 milestoneSep 11, 2018
@jklymak
Copy link
MemberAuthor

Milestonig for backport, though I don't quite agree that its "Release Critical" 😉

pharshalp reacted with thumbs up emoji

@@ -267,7 +267,8 @@ def __call__(self):
vmin = self._colorbar.norm.vmin
vmax = self._colorbar.norm.vmax
ticks = ticker.AutoMinorLocator.__call__(self)
return ticks[(ticks >= vmin) & (ticks <= vmax)]
rtol = (vmax - vmin) * 1e-10
return ticks[(ticks >= vmin - rtol) & (ticks <= vmax + rtol)]
Copy link
Member

Choose a reason for hiding this comment

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

Just as a thought: Can it happen, that vmin > vmax? If so, neither the original nor the fixed code would work in that case.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes but that gets checked and swapped inside the method before this code

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Confirmed that vmax and vmin get flipped if they are specified out of order. Which maybe is bad behaviour? But its what colorbar does...

@jklymak
Copy link
MemberAuthor

marking WIP:

  1. needs tests
  2. I guess I thinkMaxNLocator should be doing this itself; i.e. it should not (by default) return ticks that are out of range. Thats an API change though, and may break other things, so maybe beyond this PR...

@jklymak
Copy link
MemberAuthor

This is fine for now. New test fails master, passes with this PR. Yes, I could parameterize the test, but I don't think its so unwieldly as is.

The more general issue of MaxNLocator can get its own PR where it can be properly debated.

@jklymak
Copy link
MemberAuthor

Doc build seems broken, but I don't think its this PR. Something w/ stix fonts...

@tacaswelltacaswell modified the milestones:v3.0,v3.1Sep 15, 2018
@tacaswelltacaswell merged commit2c77256 intomatplotlib:masterSep 15, 2018
@lumberbot-app
Copy link

Something went wrong ... Please have a look at my logs.

tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestSep 15, 2018
FIX: make sure all ticks show up for colorbar minor tick
@tacaswelltacaswell mentioned this pull requestSep 15, 2018
@Carreau
Copy link
Contributor

Something went wrong ... Please have a look at my logs.

When things like that happen, feel free to ping me. This was an actual bug that (should) be fixed.

@tacaswell
Copy link
Member

@Carreau I would have gotten there eventually....Trying to get 3.0 finished off today 🤞

Could you also add a link to the logs in that error message? The question I was going to ask you first was "remind me how to find the logs...."

@pharshalp
Copy link
Contributor

I should have noticed this before but I forgot to add a reference to the newly introduced (in PR#11584 for 3.0) cbar.minorticks_on/off methods in the examples section (created a quick PR#12130 for that just now).

@Carreau
Copy link
Contributor

Could you also add a link to the logs in that error message? The question I was going to ask you first was "remind me how to find the logs...."

I can try, but not directly, as the link changes regularly because of authentication:

https://dashboard.heroku.com/apps/meeseeksbot

Is the closest I can get for you, then click on papertrail.

The bug is (was?) in an optimisation I was doing of reusing previously cloned matplotlib, where tring to fetch a branch fails as it is already the checked-out branch.

That was becoming necessary as matplotlib takes ~70 seconds to clone which is too close the timeout where the bot get killed.

Copy link

@peterkinalexpeterkinalex left a comment

Choose a reason for hiding this comment

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

lib / matplotlib / colorbar.py :

@matplotlibmatplotlib deleted a comment frompeterkinalexSep 18, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@peterkinalexpeterkinalexpeterkinalex left review comments

@timhoffmtimhoffmtimhoffm approved these changes

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

Successfully merging this pull request may close these issues.

6 participants
@jklymak@Carreau@tacaswell@pharshalp@peterkinalex@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp