-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Regression: imshow on geo axes produces an empty plot in matplotlib 2.0.0 #7903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It appears that in 1.5.3 the image was being created in Cartesian coordinates and then clipped to the projection. Is this what you want? |
Yes. |
That seems like fundamentally incorrect behavior, doesn't it? Wouldn't most users expect that if anything, imshow with a projection would warp the image to that projection? It's never done that, though. In 2.0 its behavior with a log scale on one or both axes has changed so that it does map the image to the scale, but I think that its behavior with a non-affine projection has always been undefined. If so, it should raise an error. Alternatively, I suppose it could warn and drop back to the 1.5.x behavior. Comments, @mdboom? |
I was looking through past PRs... did this change occur in #5718? |
yes, that is the rework that Eric is referring to.
…On Mon, Jan 23, 2017 at 5:04 PM, Leo Singer ***@***.***> wrote:
I was looking through past PRs... did this change occur in #5718
<#5718>?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7903 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-F-GjvXUZW3O-sXcDqGT0iE0cRvwks5rVSPRgaJpZM4Lp_U0>
.
|
Oh, OK! I modified my test code to use #!/usr/bin/env python
from matplotlib import pyplot as plt
import numpy as np
lon = np.linspace(-np.pi, np.pi)
lat = np.linspace(-np.pi/2, np.pi/2)
lon, lat = np.meshgrid(lon, lat)
ax = plt.axes(projection='mollweide')
ax.grid()
ax.imshow(lon, extent=[0, 1, 0, 1], aspect=ax.get_aspect(), transform=ax.transAxes)
plt.savefig('test.png') And it works now: |
There was a change in the behavior of `Axes.imshow()` on non-affine axes. See also <matplotlib/matplotlib#7903>.
There was a change in the behavior of `Axes.imshow()` on non-affine axes. See also <matplotlib/matplotlib#7903>.
Was this just a latent bug in my own code that was revealed by the transition to 2.0.0? If so, then we can close this issue. |
Bug summary
In Matplotlib 1.5.3, it was possible to use
imshow
on geo axes (e.g. the mollweide projection defined inmatplotlib.projections.geo
. In Matplotlib 2.0.0, this produces a blank plot.Code for reproduction
Here is an example that worked in 1.5.3.
Actual outcome
This is the output on Matplotlib 2.0.0: blank axes.

Expected outcome
This was the output in Matplotlib 1.5.3.

Matplotlib version
Installed from MacPorts on OS X 10.11.6 "El Capitan". Port versions:
py27-matplotlib @1.5.3_0+cairo
py27-matplotlib @2.0.0_0+cairo
The text was updated successfully, but these errors were encountered: