8000 Deemphasize comment about extremely old Matplotlib versions in example. by anntzer · Pull Request #13196 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Deemphasize comment about extremely old Matplotlib versions in example. #13196

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
Jan 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 15 additions & 19 deletions examples/images_contours_and_fields/image_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,17 @@
# the pixel center will have the same color as it does with nearest, but
# other pixels will be interpolated between the neighboring pixels.
#
# Earlier versions of matplotlib (<0.63) tried to hide the edge effects
# from you by setting the view limits so that they would not be visible.
# A recent bugfix in antigrain, and a new implementation in the
# matplotlib._image module which takes advantage of this fix, no longer
# makes this necessary. To prevent edge effects, when doing
# interpolation, the matplotlib._image module now pads the input array
# with identical pixels around the edge. e.g., if you have a 5x5 array
# with colors a-y as below::
# To prevent edge effects when doing interpolation, Matplotlib pads the input
# array with identical pixels around the edge: if you have a 5x5 array with
# colors a-y as below::
#
# a b c d e
# f g h i j
# k l m n o
# p q r s t
# u v w x y
#
# the _image module creates the padded array,::
# Matplotlib computes the interpolation and resizing on the padded array ::
#
# a a b c d e e
# a a b c d e e
Expand All @@ -109,16 +104,17 @@
# o u v w x y y
# o u v w x y y
#
# does the interpolation/resizing, and then extracts the central region.
# This allows you to plot the full range of your array w/o edge effects,
# and for example to layer multiple images of different sizes over one
# another with different interpolation methods - see
# :doc:`/gallery/images_contours_and_fields/layer_images`.
# It also implies a performance hit, as this
# new temporary, padded array must be created. Sophisticated
# interpolation also implies a performance hit, so if you need maximal
# performance or have very large images, interpolation='nearest' is
# suggested.
# and then extracts the central region of the result. (Extremely old versions
# of Matplotlib (<0.63) did not pad the array, but instead adjusted the view
# limits to hide the affected edge areas.)
#
# This approach allows plotting the full extent of an array without
# edge effects, and for example to layer multiple images of different
# sizes over one another with different interpolation methods -- see
# :doc:`/gallery/images_contours_and_fields/layer_images`. It also implies
# a performance hit, as this new temporary, padded array must be created.
# Sophisticated interpolation also implies a performance hit; for maximal
# performance or very large images, interpolation='nearest' is suggested.

A = np.random.rand(5, 5)

Expand Down
0