10000 imshow in 2.1: color resolution depends on outliers? · Issue #10567 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
imshow in 2.1: color resolution depends on outliers?  #10567
Closed
@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

    0