Skip to content

imshow in 2.1: color resolution depends on outliers?  #10567

@trettberg

Description

@trettberg

Since 2.1 the effective color resolution of imshow(x, vmin=-1, vmax=1) seems to depend on large outliers in x.

Is this intended behavior?

Thanks for clarification!

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt

x = np.linspace(-1, 1, 500 )
x = np.ones([20, 1]) * x[np.newaxis, :]

x1 = x.copy()
x1[0, 0] = 1e16

x2 = x.copy()
x2[0, 0] = 1e17

_, axes = plt.subplots(nrows=3)
axes[0].imshow(x, vmin=-1, vmax=1)
axes[1].imshow(x1, vmin=-1, vmax=1)
axes[2].imshow(x2, vmin=-1, vmax=1)

axes[0].set_title(mpl.__version__)
plt.show()

Actual outcome
figure_1-1

Expected outcome
figure_1

Matplotlib version

  • Operating system: Linux
  • Matplotlib version: 2.1.0 (expected behavior in 2.0.2)
  • Matplotlib backend: Qt5Agg
  • Python version: 3.6.4
  • Other libraries: numpy 1.13.3
  • via conda

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy