GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — imshow() pixelization in matplotlib 2.0.2 but not in 2.0.0 · Issue #8723 · matplotlib/matplotlib

imshow() pixelization in matplotlib 2.0.2 but not in 2.0.0 #8723

New issue
Copy link
New issue
Copy link
Closed
Closed
imshow() pixelization in matplotlib 2.0.2 but not in 2.0.0#8723
Copy link
Assignees
tacaswell
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.status: duplicate
Milestone
v2.1

Description

@diogoff
diogoff
opened on Jun 6, 2017
Issue body actions

I'm plotting the same image (a numpy float32 array) with imshow(..., interpolation='bilinear') on matplotlib 2.0.0 and 2.0.2.

Click to see in full:
matplotlib

On 2.0.0 the image is perfectly smooth. However, on 2.0.2 there are noticeable pixelization effects.

Has imshow() changed between these two versions?

Activity

  1. WeatherGod commented on Jun 6, 2017

    @WeatherGod
    WeatherGod
    on Jun 6, 2017 via email
    Member
    More actions
    There have been some bugfixes, IIRC, mostly related to the handling of NaNs and masked points. Are there any in your data?
    …
    On Tue, Jun 6, 2017 at 10:54 AM, diogoff ***@***.***> wrote: I'm plotting the same image (a numpy float32 array) with imshow(..., interpolation='bilinear') on matplotlib 2.0.0 and 2.0.2. See the following figure: [image: matplotlib] <https://cloud.githubusercontent.com/assets/7391155/26835386/20980584-4ad0-11e7-8719-83beec5126d5.png> On 2.0.0 the image is perfectly smooth. However, on 2.0.2 there are noticeable pixelization effects. Has the imshow() routine changed? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#8723>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AARy-PvqiPeroQYvc-abNuKTIJk7LZINks5sBWhDgaJpZM4Nxdr0> .
  2. WeatherGod commented on Jun 6, 2017

    @WeatherGod
    WeatherGod
    on Jun 6, 2017 via email
    Member
    More actions
    Another possible source of issues *might* be colormap handling. It would be helpful to have a minimum working example to investigate with.
    …
    On Tue, Jun 6, 2017 at 11:23 AM, Benjamin Root ***@***.***> wrote: There have been some bugfixes, IIRC, mostly related to the handling of NaNs and masked points. Are there any in your data? On Tue, Jun 6, 2017 at 10:54 AM, diogoff ***@***.***> wrote: > I'm plotting the same image (a numpy float32 array) with imshow(..., > interpolation='bilinear') on matplotlib 2.0.0 and 2.0.2. > > See the following figure: > [image: matplotlib] > <https://cloud.githubusercontent.com/assets/7391155/26835386/20980584-4ad0-11e7-8719-83beec5126d5.png> > > On 2.0.0 the image is perfectly smooth. However, on 2.0.2 there are > noticeable pixelization effects. > > Has the imshow() routine changed? > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <#8723>, or mute the > thread > <https://github.com/notifications/unsubscribe-auth/AARy-PvqiPeroQYvc-abNuKTIJk7LZINks5sBWhDgaJpZM4Nxdr0> > . >
    Reacted by Paul Hobson
  3. diogoff commented on Jun 6, 2017

    @diogoff
    diogoff
    on Jun 6, 2017
    Author
    More actions

    Here is a MWE:

    import matplotlib.pyplot as plt
    
    data = [[ 0.001071,  0.032820,  0.105207,  0.127595,  0.147364,  0.124911,  0.073015,  0.000074, -0.003899, -0.001462],
            [ 0.000787,  0.031720,  0.107091,  0.183722,  0.202479,  0.204296,  0.154234,  0.085757,  0.026941, -0.003271],
            [ 0.001480, -0.000771,  0.016654,  0.214761,  0.278136,  0.304099,  0.246056,  0.169364,  0.085205, -0.001907],
            [ 0.000549, -0.000475,  0.001674,  0.247847,  0.345098,  0.378256,  0.332674,  0.229220,  0.133641,  0.053745],
            [ 0.000000,  0.002675,  0.001689,  0.266309,  0.414319,  0.459767,  0.425990,  0.317280,  0.190170,  0.099265],
            [ 0.000000,  0.001037, -0.002923,  0.254976,  0.408347,  0.529809,  0.532195,  0.406330,  0.272445,  0.163764],
            [ 0.000000,  0.000792, -0.013151,  0.216619,  0.397671,  0.567617,  0.616055,  0.508699,  0.379961,  0.263546],
            [ 0.000000,  0.002062, -0.016293,  0.157240,  0.368229,  0.613702,  0.712611,  0.639131,  0.505910,  0.338813],
            [ 0.000000,  0.001741,  0.003448,  0.100818,  0.333026,  0.611874,  0.787059,  0.773407,  0.644049,  0.450520],
            [ 0.000000, -0.001268, -0.008104,  0.061512,  0.294558,  0.604565,  0.814691,  0.865676,  0.776763,  0.557480],
            [ 0.000000, -0.001105, -0.002768,  0.036252,  0.252868,  0.544436,  0.775150,  0.920004,  0.890915,  0.690601],
            [ 0.000000, -0.001123, -0.003589,  0.028705,  0.194056,  0.471003,  0.728520,  0.921639,  0.969436,  0.773769],
            [ 0.000000, -0.000430, -0.004625,  0.017730,  0.149156,  0.423797,  0.677714,  0.912435,  0.984722,  0.846838],
            [ 0.000000,  0.000000, -0.002619,  0.036928,  0.136544,  0.410567,  0.666038,  0.905706,  0.942078,  0.894590],
            [ 0.000000, -0.000296, -0.003399,  0.050115,  0.189001,  0.451915,  0.696602,  0.869335,  0.893818,  0.826647],
            [ 0.000000,  0.000174, -0.003604,  0.083219,  0.248855,  0.517874,  0.739961,  0.843343,  0.803800,  0.718687],
            [-0.001720,  0.005825,  0.078039,  0.154466,  0.324385,  0.550980,  0.745479,  0.817428,  0.750877,  0.624806],
            [ 0.000719, -0.004020,  0.118178,  0.218264,  0.395383,  0.585784,  0.748400,  0.744401,  0.620376,  0.464464],
            [ 0.003257,  0.066374,  0.142013,  0.270861,  0.458675,  0.621705,  0.691592,  0.590108,  0.491103,  0.346859],
            [ 0.042411,  0.111464,  0.193880,  0.308119,  0.475352,  0.602842,  0.600717,  0.487950,  0.392807,  0.258806]]
    
    plt.imshow(data, vmin=0., vmax=1., interpolation='bilinear')
    plt.axis('off')
    plt.show()
    

    matplotlib

  4. WeatherGod commented on Jun 6, 2017

    @WeatherGod
    WeatherGod
    on Jun 6, 2017 via email
    Member
    More actions
    It is almost like it is treating those zeros as masked out, isn't it? attn: @tacaswell
    …
    On Tue, Jun 6, 2017 at 5:08 PM, diogoff ***@***.***> wrote: Here is a MWE: import matplotlib.pyplot as plt data = [[ 0.001071, 0.032820, 0.105207, 0.127595, 0.147364, 0.124911, 0.073015, 0.000074, -0.003899, -0.001462], [ 0.000787, 0.031720, 0.107091, 0.183722, 0.202479, 0.204296, 0.154234, 0.085757, 0.026941, -0.003271], [ 0.001480, -0.000771, 0.016654, 0.214761, 0.278136, 0.304099, 0.246056, 0.169364, 0.085205, -0.001907], [ 0.000549, -0.000475, 0.001674, 0.247847, 0.345098, 0.378256, 0.332674, 0.229220, 0.133641, 0.053745], [ 0.000000, 0.002675, 0.001689, 0.266309, 0.414319, 0.459767, 0.425990, 0.317280, 0.190170, 0.099265], [ 0.000000, 0.001037, -0.002923, 0.254976, 0.408347, 0.529809, 0.532195, 0.406330, 0.272445, 0.163764], [ 0.000000, 0.000792, -0.013151, 0.216619, 0.397671, 0.567617, 0.616055, 0.508699, 0.379961, 0.263546], [ 0.000000, 0.002062, -0.016293, 0.157240, 0.368229, 0.613702, 0.712611, 0.639131, 0.505910, 0.338813], [ 0.000000, 0.001741, 0.003448, 0.100818, 0.333026, 0.611874, 0.787059, 0.773407, 0.644049, 0.450520], [ 0.000000, -0.001268, -0.008104, 0.061512, 0.294558, 0.604565, 0.814691, 0.865676, 0.776763, 0.557480], [ 0.000000, -0.001105, -0.002768, 0.036252, 0.252868, 0.544436, 0.775150, 0.920004, 0.890915, 0.690601], [ 0.000000, -0.001123, -0.003589, 0.028705, 0.194056, 0.471003, 0.728520, 0.921639, 0.969436, 0.773769], [ 0.000000, -0.000430, -0.004625, 0.017730, 0.149156, 0.423797, 0.677714, 0.912435, 0.984722, 0.846838], [ 0.000000, 0.000000, -0.002619, 0.036928, 0.136544, 0.410567, 0.666038, 0.905706, 0.942078, 0.894590], [ 0.000000, -0.000296, -0.003399, 0.050115, 0.189001, 0.451915, 0.696602, 0.869335, 0.893818, 0.826647], [ 0.000000, 0.000174, -0.003604, 0.083219, 0.248855, 0.517874, 0.739961, 0.843343, 0.803800, 0.718687], [-0.001720, 0.005825, 0.078039, 0.154466, 0.324385, 0.550980, 0.745479, 0.817428, 0.750877, 0.624806], [ 0.000719, -0.004020, 0.118178, 0.218264, 0.395383, 0.585784, 0.748400, 0.744401, 0.620376, 0.464464], [ 0.003257, 0.066374, 0.142013, 0.270861, 0.458675, 0.621705, 0.691592, 0.590108, 0.491103, 0.346859], [ 0.042411, 0.111464, 0.193880, 0.308119, 0.475352, 0.602842, 0.600717, 0.487950, 0.392807, 0.258806]] plt.imshow(data, vmin=0., vmax=1., interpolation='bilinear') plt.axis('off') plt.show() [image: matplotlib] <https://user-images.githubusercontent.com/7391155/26851969-802a9fb4-4b04-11e7-8d29-4d49e3df3c30.png> — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#8723 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AARy-Btlf7KfBsDWGii3gi5L-MELxm0Yks5sBb-zgaJpZM4Nxdr0> .
  5. diogoff commented on Jun 6, 2017

    @diogoff
    diogoff
    on Jun 6, 2017
    Author
    More actions

    The pixelization appears around the negative values which are being clipped by vmin=0.

  6. WeatherGod commented on Jun 6, 2017

    @WeatherGod
    WeatherGod
    on Jun 6, 2017 via email
    Member
    More actions
    you are right. It is the pixels that fall below vmin. There was some recent work around vmin/vmax. maybe that had some unintended consequences?
    …
    On Tue, Jun 6, 2017 at 5:14 PM, diogoff ***@***.***> wrote: The pixelization appears around the negative values which are being clipped by vmin=0. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#8723 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AARy-D53Gn1CAvCdzYvawoSBkw6yQ4YQks5sBcElgaJpZM4Nxdr0> .
  7. diogoff commented on Jun 6, 2017

    @diogoff
    diogoff
    on Jun 6, 2017
    Author
    More actions

    It seems that when those (negative) pixels are being clipped, the interpolation no longer works as it used to.
    Thanks for your help.

  8. WeatherGod commented on Jun 6, 2017

    @WeatherGod
    WeatherGod
    on Jun 6, 2017 via email
    Member
    More actions
    Possible culprit: #8024
    …
    On Tue, Jun 6, 2017 at 5:22 PM, diogoff ***@***.***> wrote: It seems that when those (negative) pixels are being clipped, the interpolation no longer works as it used to. Thanks for your help. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#8723 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AARy-NkZqs3thlZAIm4n-tE0ITMSxu_Qks5sBcL-gaJpZM4Nxdr0> .
  9. dstansby commented on Jun 15, 2017

    @dstansby
    dstansby
    on Jun 15, 2017
    Member
    More actions

    Yep, this bisects to 1a7c4ef

  10. tacaswell commented on Jun 17, 2017

    @tacaswell
    tacaswell
    on Jun 17, 2017
    Member
    More actions

    This is a duplicate of #8631 which has a proposed solution in the comments.

  11. tacaswell
    added this to the This milestone has been deleted milestone on Jun 17, 2017
  12. tacaswell
    added
    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
    status: duplicate
    on Jun 17, 2017
  13. tacaswell
    self-assigned this
    on Jul 25, 2017
  14. tacaswell commented on Aug 31, 2017

    @tacaswell
    tacaswell
    on Aug 31, 2017
    Member
    More actions

    Closed by #8966

  15. tacaswell
    closed this as completedon Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tacaswell
    tacaswell

Labels

Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.status: duplicate

Type

No type

Projects

No projects

    Milestone

    • v2.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.