Skip to content

Commit 3a524b2

Browse files
committed
Deemphasize comment about extremely old Matplotlib versions in example.
Leaving it there as an parenthetical remark "for historical purposes".
1 parent 9fb8ae4 commit 3a524b2

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

examples/images_contours_and_fields/image_demo.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,17 @@
8484
# the pixel center will have the same color as it does with nearest, but
8585
# other pixels will be interpolated between the neighboring pixels.
8686
#
87-
# Earlier versions of matplotlib (<0.63) tried to hide the edge effects
88-
# from you by setting the view limits so that they would not be visible.
89-
# A recent bugfix in antigrain, and a new implementation in the
90-
# matplotlib._image module which takes advantage of this fix, no longer
91-
# makes this necessary. To prevent edge effects, when doing
92-
# interpolation, the matplotlib._image module now pads the input array
93-
# with identical pixels around the edge. e.g., if you have a 5x5 array
94-
# with colors a-y as below::
87+
# To prevent edge effects when doing interpolation, Matplotlib pads the input
88+
# array with identical pixels around the edge: if you have a 5x5 array with
89+
# colors a-y as below::
9590
#
9691
# a b c d e
9792
# f g h i j
9893
# k l m n o
9994
# p q r s t
10095
# u v w x y
10196
#
102-
# the _image module creates the padded array,::
97+
# Matplotlib computes the interpolation and resizing on the padded array ::
10398
#
10499
# a a b c d e e
105100
# a a b c d e e
@@ -109,16 +104,17 @@
109104
# o u v w x y y
110105
# o u v w x y y
111106
#
112-
# does the interpolation/resizing, and then extracts the central region.
113-
# This allows you to plot the full range of your array w/o edge effects,
114-
# and for example to layer multiple images of different sizes over one
115-
# another with different interpolation methods - see
116-
# :doc:`/gallery/images_contours_and_fields/layer_images`.
117-
# It also implies a performance hit, as this
118-
# new temporary, padded array must be created. Sophisticated
119-
# interpolation also implies a performance hit, so if you need maximal
120-
# performance or have very large images, interpolation='nearest' is
121-
# suggested.
107+
# and then extracts the central region of the result. (Extremely old versions
108+
# of Matplotlib (<0.63) did not pad the array, but instead adjusted the view
109+
# limits to hide the affected edge areas.)
110+
#
111+
# This approach allows plotting the full extent of an array without
112+
# edge effects, and for example to layer multiple images of different
113+
# sizes over one another with different interpolation methods -- see
114+
# :doc:`/gallery/images_contours_and_fields/layer_images`. It also implies
115+
# a performance hit, as this new temporary, padded array must be created.
116+
# Sophisticated interpolation also implies a performance hit; for maximal
117+
# performance or very large images, interpolation='nearest' is suggested.
122118

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

0 commit comments

Comments
 (0)