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

Commit cc090bb

Browse filesBrowse files
authored
Merge pull request #9352 from matplotlib/auto-backport-of-pr-9335
Backport PR #9335 on branch v2.1.x
2 parents 516bc19 + 679d3ed commit cc090bb
Copy full SHA for cc090bb

File tree

Expand file treeCollapse file tree

3 files changed

+14
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+14
-3
lines changed
Open diff view settings
Collapse file

‎lib/matplotlib/backends/qt_editor/figureoptions.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/qt_editor/figureoptions.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import re
1717

1818
import matplotlib
19-
from matplotlib import cm, markers, colors as mcolors
19+
from matplotlib import cm, colors as mcolors, markers, image as mimage
2020
import matplotlib.backends.qt_editor.formlayout as formlayout
2121
from matplotlib.backends.qt_compat import QtGui
2222

@@ -165,7 +165,7 @@ def prepare_data(d, init):
165165
('Max. value', high),
166166
('Interpolation',
167167
[image.get_interpolation()]
168-
+ [(name, name) for name in sorted(image.iterpnames)])]
168+
+ [(name, name) for name in sorted(mimage.interpolations_names)])]
169169
images.append([imagedata, label, ""])
170170
# Is there an image displayed?
171171
has_image = bool(images)
Collapse file

‎lib/matplotlib/image.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/image.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,18 @@ def _rgb_to_rgba(A):
180180
class _ImageBase(martist.Artist, cm.ScalarMappable):
181181
zorder = 0
182182

183+
@property
183184
@cbook.deprecated("2.1")
184185
def _interpd(self):
185186
return _interpd_
186187

188+
@property
187189
@cbook.deprecated("2.1")
188190
def _interpdr(self):
189191
return {v: k for k, v in six.iteritems(_interpd_)}
190192

191-
@cbook.deprecated("2.1")
193+
@property
194+
@cbook.deprecated("2.1", alternative="mpl.image.interpolation_names")
192195
def iterpnames(self):
193196
return interpolations_names
194197

Collapse file

‎lib/matplotlib/tests/test_image.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_image.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,3 +827,11 @@ def test_imshow_float128():
827827
def test_imshow_bool():
828828
fig, ax = plt.subplots()
829829
ax.imshow(np.array([[True, False], [False, True]], dtype=bool))
830+
831+
832+
def test_imshow_deprecated_interd_warn():
833+
im = plt.imshow([[1, 2], [3, np.nan]])
834+
for k in ('_interpd', '_interpdr', 'iterpnames'):
835+
with warnings.catch_warnings(record=True) as warns:
836+
getattr(im, k)
837+
assert len(warns) == 1

0 commit comments

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