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: image respect norm limits w/ None#11047

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

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedApr 13, 2018
edited
Loading

PR Summary

Re-closes#10072

We are slowly suqishing the "big number" bugs in imshow.

This one was caused by only specifyingvmax but notvmin. Algorithm is the same as before, but ifvmin isNone, then we scale bya_min.

importmatplotlib.pyplotaspltimportnumpyasnpx=np.random.random([3,3])x[1,1]=1.e80plt.imshow(x,vmax=2)plt.show()

Before

figure_1

After

figur

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

@jklymakjklymak added this to thev2.2.3 milestoneApr 13, 2018
@jklymakjklymak requested a review fromtacaswellApril 13, 2018 16:50
a_max = np.float64(newmax)
if newmax is not None or newmin is not None:
A_scaled = np.clip(A_scaled, newmin, newmax)
vmin = self.norm.vmin if self.norm.vmin is not None else a_min
Copy link
Member

Choose a reason for hiding this comment

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

I would doif self.norm.vmin is None or self.norm.vmax is None: self.norm.autoscale_None(A)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sure - its OK to modify the norm here?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

don't even need the if-statement in that case.

@jklymakjklymakforce-pushed thefix-image-respect-norm-limits branch from9d17f6f to023ddb8CompareApril 13, 2018 19:53
@jklymak
Copy link
MemberAuthor

Ping@tacaswell

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.

Please squash before merging.

@jklymakjklymakforce-pushed thefix-image-respect-norm-limits branch from023ddb8 to918c8a5CompareMay 6, 2018 15:28
@jklymak
Copy link
MemberAuthor

squashed and rebased....

@jklymakjklymak closed thisMay 6, 2018
@jklymakjklymak reopened thisMay 6, 2018
@jklymakjklymak requested a review fromtacaswellMay 7, 2018 21:45
@jklymakjklymakforce-pushed thefix-image-respect-norm-limits branch from918c8a5 to8d53a8aCompareMay 9, 2018 20:32
@tacaswelltacaswell merged commit59e550b intomatplotlib:masterMay 14, 2018
@lumberbot-app
Copy link

There seem to be a conflict, please backport manually

@dstansby
Copy link
Member

Does this want a backport to2.2.x?

tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestAug 4, 2018
…rm-limitsFIX: image respect norm limits w/ NoneConflicts:lib/matplotlib/image.py          - keep changes backported from master.  Looks like conflict            was due to some white-space clean up done on master.
@tacaswell
Copy link
Member

backported to v2.2.x asfaf9684

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

@tacaswelltacaswellAwaiting requested review from tacaswell

Assignees
No one assigned
Projects
None yet
Milestone
v2.2.3
Development

Successfully merging this pull request may close these issues.

imshow doesn't properly display some images
4 participants
@jklymak@dstansby@tacaswell@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp