Panning/zooming a wcs plot broken with (unreleased) Matplotlib 3.1.0
See original GitHub issueDescription
Zooming or panning a plot with a wcs projection is broken with the current master branch of Maptlotlib, that should shortly be released as version 3.1.0
. I am aware that this is not the best bug report, but I thought I’d leave it anyway as a placeholder for fixing at some point.
This might be an upstream Maptlotlib issue.
Steps to Reproduce
- Install Matplotlib master branch
- Run the following code:
from matplotlib import pyplot as plt
from astropy.io import fits
from astropy.wcs import WCS
from astropy.utils.data import get_pkg_data_filename
filename = get_pkg_data_filename('tutorials/FITS-images/HorseHead.fits')
hdu = fits.open(filename)[0]
wcs = WCS(hdu.header)
fig = plt.figure()
fig.add_subplot(111, projection=wcs)
plt.imshow(hdu.data)
plt.show()
- Try to zoom/pan
Error message is:
Traceback (most recent call last):
File "/Users/dstansby/miniconda3/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 743, in array_split
Ntotal = ary.shape[axis]
AttributeError: 'NoneType' object has no attribute 'shape'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dstansby/github/matplotlib/lib/matplotlib/cbook/__init__.py", line 216, in process
func(*args, **kwargs)
File "/Users/dstansby/github/matplotlib/lib/matplotlib/backend_bases.py", line 2791, in press_pan
if (x is not None and y is not None and a.in_axes(event) and
File "/Users/dstansby/github/matplotlib/lib/matplotlib/axes/_base.py", line 2126, in in_axes
return self.patch.contains(mouseevent)[0]
File "/Users/dstansby/github/matplotlib/lib/matplotlib/patches.py", line 144, in contains
Path, np.split(vertices, idxs), np.split(codes, idxs))), {}
File "/Users/dstansby/miniconda3/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 850, in split
res = array_split(ary, indices_or_sections, axis)
File "/Users/dstansby/miniconda3/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 745, in array_split
Ntotal = len(ary)
TypeError: object of type 'NoneType' has no len()
Traceback (most recent call last):
File "/Users/dstansby/miniconda3/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 743, in array_split
Ntotal = ary.shape[axis]
AttributeError: 'NoneType' object has no attribute 'shape'
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Activity - QGIS Application - QGIS Issue Tracking
Renders but then crashes when panning/zooming. ... I've tried today to install QGIS 3.2 on mac osx with Python 3.7 new install. No...
Read more >https://raw.githubusercontent.com/qgis/QGIS/final-...
The good news is that CMake is able to figure out itself which headers need ... Summary The new API makes it available...
Read more >POLITECNICO DI TORINO Repository ISTITUZIONALE - CORE
Figure 2: Functioning SDI. 1.5 GIS SOFTWARE NEEDS IN SDIS. A Spatial Data Infrastructure should enable the discovery and delivery of spatial ...
Read more >Thu, 31 Mar 2016 - CRANberries
Description: This is a two-in-one package which provides interfaces to both R and Python. It implements fast hierarchical, ...
Read more >The Analysis of Open Source Software and Data for ...
Figure 1: Components Of A Spatial Data Infrastructure ... Open Geospatial Consortium Web Coverage Service Interface Standard (WCS) defines Web-based ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doing a bit of investigating, this bisects to https://github.com/matplotlib/matplotlib/pull/10776 in Matplotlib
I’m using the
QT5Agg
backend.