Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add section on artifacts to imshow docs #16999

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
Apr 5, 2020

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Apr 1, 2020

PR Summary

Closes #16976.

And some minor cleanups.

@timhoffm timhoffm added this to the v3.3.0 milestone Apr 1, 2020
@timhoffm timhoffm force-pushed the doc-imshow-artifacts branch from ae5866c to 5ee5a19 Compare April 2, 2020 19:13
Copy link
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

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

Made some changes, approve even if you discard them.

match the number of pixels given in *X*. *interpolation* is used to
calculate the displayed pixels, which is inherently prone to visual
artifacts. Depending on the ratio of given to need pixels different
interpolation methods may be preferable.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe:

"""
The number of pixels used to render an image is set by the axes 
size and the *dpi* of the figure, so the image size will usually not 
match the size of *X*, which can lead to aliasing artifacts when the 
image is resampled 
(see :doc:`/gallery/images_contours_and_fields/image_antialiasing`).  
The resampling can be controlled via the *interpolation* kwarg 
and/or :rc:`image.interpolation`, which defaults to 'antialiased'.
"""

Copy link
Member

Choose a reason for hiding this comment

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

Sorry my suggedtions crosses @story645 please meld as you see fit.

Copy link
Member

@story645 story645 Apr 2, 2020

Choose a reason for hiding this comment

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

I think yours is mostly clearer, but I'd break it up a little:

"""The number of pixels used to render an image is set by the axes 
size and the *dpi* of the figure. This can lead to aliasing artifacts when the 
image is resampled because the displayed image size will usually not 
match the size of *X*."""

Copy link
Member

Choose a reason for hiding this comment

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

.. agreed, that was a run-on sentence.

@timhoffm timhoffm force-pushed the doc-imshow-artifacts branch from 025ccc3 to b44d4ca Compare April 4, 2020 00:52
@@ -5433,7 +5441,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
The filter radius for filters that have a radius parameter, i.e.
when interpolation is one of: 'sinc', 'lanczos' or 'blackman'.

resample : bool, optional
resample : bool, default: False
Copy link
Member

Choose a reason for hiding this comment

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

The default for AxesImage is False; the default for imshow is None, which means the default here should be the 'image.resample' rcParam.

Co-authored-by: Jody Klymak <[email protected]>
Co-authored-by: hannah <[email protected]>
@timhoffm timhoffm force-pushed the doc-imshow-artifacts branch from b44d4ca to a32fb6a Compare April 4, 2020 18:16
Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

Anyone can merge on CI green.

@timhoffm
Copy link
Member Author

timhoffm commented Apr 5, 2020

Travis OSX failure is unreleated.

@timhoffm timhoffm merged commit 1709db8 into matplotlib:master Apr 5, 2020
@timhoffm timhoffm deleted the doc-imshow-artifacts branch April 5, 2020 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thin line color distortion on large scale
5 participants