Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug report
Bug summary
#19153 introduced some changes that had (I think) unintended consequences when passing custom kwargs to projections
Code for reproduction
Prior to#19153, the following code returnedFalse
, that is, two different axes were created:
fromastropy.wcsimportWCSimportmatplotlib.pyplotaspltwcs1=WCS(naxis=3)wcs1.wcs.ctype= ['x','y','z']ax1=plt.subplot(1,1,1,projection=wcs1,slices=('x','y',1))wcs2=WCS(naxis=3)wcs2.wcs.ctype= ['a','b','c']ax2=plt.subplot(1,1,1,projection=wcs2,slices=('x',2,'y'))print(ax1isax2)
No deprecation warning or future warning was raised in this case.
Following#19153, this silently ignores the projection and slices in the second call and the print statement returnsTrue
.
I don't think#19153 was intended to start makingplt.subplot
return the same axes in some cases, rather I thought the goal of that PR was to remove re-use of axes in certain circumstances, so I think this is a regression/bug
Actual outcome
ax1
andax2
are the same
Expected outcome
ax1
andax2
should be different