|
8 | 8 | array, it is rare that the size of the data array exactly matches the number of
|
9 | 9 | pixels allotted to the image in the figure, so Matplotlib resamples or `scales
|
10 | 10 | <https://en.wikipedia.org/wiki/Image_scaling>`_ the data or image to fit. If
|
11 |
| -the data array is larger than the number of pixels allotted in the image file, |
| 11 | +the data array is larger than the number of pixels allotted in the rendered figure, |
12 | 12 | then the image will be "down-sampled" and image information will be lost.
|
13 |
| -Conversely, if the data array is smaller than the number of pixels then each |
| 13 | +Conversely, if the data array is smaller than the number of output pixels then each |
14 | 14 | data point will get multiple pixels, and the image is "up-sampled".
|
15 | 15 |
|
16 | 16 | In the following figure, the first data array has size (450, 450), but is
|
|
126 | 126 | # white regions to the image that are not in the original data, both in the
|
127 | 127 | # alternating bands on the left hand side of the image, and in the boundary
|
128 | 128 | # between the red and blue of the large circles in the middle of the image.
|
129 |
| -# The interpolation at the 'rgba' stage is more natural, with the alternating |
| 129 | +# The interpolation at the 'rgba' stage has a different artifact, with the alternating |
130 | 130 | # bands coming out a shade of purple; even though purple is not in the original
|
131 | 131 | # colormap, it is what we perceive when a blue and red stripe are close to each
|
132 | 132 | # other.
|
|
165 | 165 |
|
166 | 166 | # %%
|
167 | 167 | # A final example shows the desirability of performing the anti-aliasing at
|
168 |
| -# the RGBA stage. In the following, the data in the upper 100 rows is exactly |
| 168 | +# the RGBA stage when using non-trivial interpolation kernels. In the following, |
| 169 | +# the data in the upper 100 rows is exactly |
169 | 170 | # 0.0, and data in the inner circle is exactly 2.0. If we perform the
|
170 | 171 | # *interpolation_stage* in 'data' space and use an anti-aliasing filter (first
|
171 | 172 | # panel), then floating point imprecision makes some of the data values just a
|
|
0 commit comments