8000 Update antialiased default to auto and fix documentation errors · matplotlib/matplotlib@d9dad87 · GitHub
[go: up one dir, main page]

Skip to content

Commit d9dad87

Browse files
Update antialiased default to auto and fix documentation errors
1 parent dd8dbca commit d9dad87

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

galleries/examples/images_contours_and_fields/image_antialiasing.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#
6464
# ``interpolation_stage='data'``: Data -> Interpolate/Resample -> Normalize -> RGBA
6565
#
66-
# For both keyword arguments, Matplotlib has a default "antialiased", that is
66+
# For both keyword arguments, Matplotlib has a default "auto", that is
6767
# recommended for most situations, and is described below. Note that this
6868
# default behaves differently if the image is being down- or up-sampled, as
6969
# described below.
@@ -166,16 +166,19 @@
166166
# %%
167167
# A final example shows the desirability of performing the anti-aliasing at the
168168
# RGBA stage when using non-trivial interpolation kernels. In the following,
169-
# the data in the upper 100 rows is exactly 0.0, and data in the inner circle
169+
# the data in the outer circle is exactly 0.0, and data in the inner circle
170170
# is exactly 2.0. If we perform the *interpolation_stage* in 'data' space and
171171
# use an anti-aliasing filter (first panel), then floating point imprecision
172172
# makes some of the data values just a bit less than zero or a bit more than
173173
# 2.0, and they get assigned the under- or over- colors. This can be avoided if
174-
# you do not use an anti-aliasing filter (*interpolation* set set to
174+
# you do not use an anti-aliasing filter (*interpolation* set to
175175
# 'nearest'), however, that makes the part of the data susceptible to Moiré
176176
# patterns much worse (second panel). Therefore, we recommend the default
177177
# *interpolation* of 'hanning'/'auto', and *interpolation_stage* of
178178
# 'rgba'/'auto' for most down-sampling situations (last panel).
179+
# In this example, the data values are clipped at the edges of the color range.
180+
# The interpolation uses the 'nearest' method, and as a result, no
181+
# floating-point imprecision is visible in the first panel.
179182

180183
a = alarge + 1
181184
cmap = plt.get_cmap('RdBu_r')

0 commit comments

Comments
 (0)
0