imshow with big-endian data types on OS X #1005

Closed
danielflanigan opened this Issue Jul 10, 2012 · 6 comments

Comments

Projects
None yet
5 participants
@danielflanigan

When using imshow with an array of type >f, >f2, >f4, or >f8, the pixel(s) with maximum value in the array appears in the color of the minimum value.

a = array([[1, 0], [0, -1]])
imshow(a.astype('>f'))

This issue appeared on two systems:
OS X 10.7.4
numpy 1.6.2
matplotlib 1.1.0 with backend MacOSX
and
OS X 10.6.8
numpy 1.6.1
matplotlib 1.1.1 with backend TkAgg

This issue did not appear on a linux x86_64 system running
numpy 1.6.1
matplotlib 1.0.1 with backend GTKAgg

@WeatherGod

This comment has been minimized.

Show comment
Hide comment
@WeatherGod

WeatherGod Aug 15, 2012

Member

Could we get a MacOSX user to confirm the existence of this bug?

Member

WeatherGod commented Aug 15, 2012

Could we get a MacOSX user to confirm the existence of this bug?

@jswhit

This comment has been minimized.

Show comment
Hide comment
@jswhit

jswhit Aug 15, 2012

Contributor

Confirmed. Using '>f' the image is dark blue in the upper left and lower right corners, with '<f' for just 'f', the image has red in the upper left (using an up-to-date clone of matplotlib master with either the macosx or QtAgg backends).

Contributor

jswhit commented Aug 15, 2012

Confirmed. Using '>f' the image is dark blue in the upper left and lower right corners, with '<f' for just 'f', the image has red in the upper left (using an up-to-date clone of matplotlib master with either the macosx or QtAgg backends).

@efiring

This comment has been minimized.

Show comment
Hide comment
@efiring

efiring Aug 15, 2012

Member

It's not OSX-specific. I can reproduce it in a linux-64 virtual machine.
Also, it is not imshow-specific: pcolor does it.
np.version.version is '1.6.3.dev-903d9b7'

The surprising thing is that the norm is preserving the byte order; and then the conversion to an integer for the table lookup seems to be going haywire.

Member

efiring commented Aug 15, 2012

It's not OSX-specific. I can reproduce it in a linux-64 virtual machine.
Also, it is not imshow-specific: pcolor does it.
np.version.version is '1.6.3.dev-903d9b7'

The surprising thing is that the norm is preserving the byte order; and then the conversion to an integer for the table lookup seems to be going haywire.

@ghost ghost assigned efiring Aug 15, 2012

@efiring

This comment has been minimized.

Show comment
Hide comment
@efiring

efiring Aug 15, 2012

Member

I have found the line where the error is coming in. I should be able to figure out how to fix it some time today or tomorrow.

Member

efiring commented Aug 15, 2012

I have found the line where the error is coming in. I should be able to figure out how to fix it some time today or tomorrow.

@WeatherGod

This comment has been minimized.

Show comment
Hide comment
@WeatherGod

WeatherGod Aug 15, 2012

Member

Strange that you can reproduce it on a linux vm. On linux native systems, I can't reproduce it. Of course, I am not an expert in virtual machines, so I don't know if this is to be expected or not.

Member

WeatherGod commented Aug 15, 2012

Strange that you can reproduce it on a linux vm. On linux native systems, I can't reproduce it. Of course, I am not an expert in virtual machines, so I don't know if this is to be expected or not.

@efiring

This comment has been minimized.

Show comment
Hide comment
@efiring

efiring Aug 15, 2012

Member

The problem is there even when you can't see it with the visual test. I have found and fixed it locally, but I should add a test, so it may be a day or so before I send a pull request for it. It is basically a numpy bug that we have to work around.

Member

efiring commented Aug 15, 2012

The problem is there even when you can't see it with the visual test. I have found and fixed it locally, but I should add a test, so it may be a day or so before I send a pull request for it. It is basically a numpy bug that we have to work around.

efiring added a commit to efiring/matplotlib that referenced this issue Aug 16, 2012

efiring added a commit to efiring/matplotlib that referenced this issue Aug 16, 2012

@pelson pelson closed this Aug 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment