Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Regression in imshow #7373

Copy link
Copy link
Closed
Closed
Copy link
@alfredobrent

Description

@alfredobrent
Issue body actions

The imshow command in 2.0.0b4 and current master (07adcde) don't export images with colormaps correctly. The colormap is not scaled correctly:

imshow_git

This bug is not present in 1.5.1:

imshow_1 5 1

Some precisions:

  • version 1.5.1 from ubuntu 16.04 repository
  • git master (07adcde) #installed from source on ubuntu 16.04

Code to reproduce this behavior:

#!/usr/bin/env python2.7
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

print(matplotlib.__version__)

cmap = plt.cm.jet

# coordinates
bbox=20
resolution = 100

xcoords = np.linspace(0, bbox, resolution)
ycoords = np.linspace(-bbox, bbox, 2*resolution)
    
# evaluate
xnb = len(xcoords)
ynb = len(ycoords)
dat = np.zeros((ynb,xnb))
for i in range(xnb):
    for j in range(ynb):
        dat[j][i] = np.sqrt(xcoords[i]**2+ycoords[j]**2)
# export to png
plt.imsave("imshow.png", dat, cmap=cmap, vmin=0, vmax=None)

Metadata

Metadata

Assignees

No one assigned

    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: confirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.