Skip to content

[Doc]: A few problems on Image resampling page #29541

Description

@svank

Documentation Link

https://matplotlib.org/devdocs/gallery/images_contours_and_fields/image_antialiasing.html

Problem

I was reading this docs page to better understand the changes in #28061, and I noticed a few things I think need fixing:

  • Just before the "Down-sampling and modest up-sampling" header, it says "For both keyword arguments, Matplotlib has a default "antialiased"...", but that default is now auto.

  • Just before the "Up-sampling" header, the example is discussing how in the first panel, "floating point imprecision makes some of the data values just a bit less than zero or a bit more than 2.0, and they get assigned the under- or over- colors". I don't see that occurring in the first panel of the plot. I see this:

Image

but I wonder if it's supposed to look more like this plot from #28061:

Image

What I see currently in the docs is also what I get running the example locally, though. If what I see in the docs is intended,

  • In that same example, it says "In the following, the data in the upper 100 rows is exactly 0.0, and data in the inner circle is exactly 2.0." Aren't the values of exactly 0.0 in the outer circle, not the upper 100 rows?

  • Lastly, again in that example, "(interpolation set set to 'nearest')" has an extra "set".

Suggested improvement

No response

Activity

  1. jklymak commented on Jan 28, 2025

    @jklymak
    Member

    For sure a few things probably changed after this page was written. Any help you could give with it would be appreciated!

  2. SiddharthKarmokar commented on Feb 3, 2025

    @SiddharthKarmokar

    In response to the original text regarding floating-point imprecision, I’ve added the following lines to clarify the behavior in the first panel of the example:

    In this example, the data values are clipped at the edges of the color range. The interpolation uses the 'nearest' method, and as a result, no floating-point imprecision is visible in the first panel.

    Please let me know if this revision accurately reflects the intended behavior or if further adjustments are needed.

  3. added a commit that references this issue on Jul 7, 2026
    afe43fe
  4. added this to the v3.11.1 milestone on Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions