|
35 | 35 | import matplotlib.transforms as mtransforms
|
36 | 36 |
|
37 | 37 | # map interpolation strings to module constants
|
38 |
| -__interpd = { |
| 38 | +_interpd_ = { |
39 | 39 | 'none': _image.NEAREST, # fall back to nearest when not supported
|
40 | 40 | 'nearest': _image.NEAREST,
|
41 | 41 | 'bilinear': _image.BILINEAR,
|
|
57 | 57 | }
|
58 | 58 |
|
59 | 59 |
|
60 |
| -interpolations_names = list(six.iterkeys(__interpd)) |
| 60 | +interpolations_names = list(six.iterkeys(_interpd_)) |
61 | 61 |
|
62 | 62 | class _AxesImageBase(martist.Artist, cm.ScalarMappable):
|
63 | 63 | zorder = 0
|
64 | 64 |
|
65 | 65 | # the 3 following keys seem to be unused now, keep it for backward compat just in case.
|
66 |
| - _interpd = __interpd |
| 66 | + _interpd = _interpd_ |
67 | 67 | # reverse interp dict
|
68 |
| - _interpdr = dict([(v, k) for k, v in six.iteritems(__interpd)]) |
| 68 | + _interpdr = dict([(v, k) for k, v in six.iteritems(_interpd_)]) |
69 | 69 | iterpnames = interpolations_names
|
70 | 70 | # <end unused keys>
|
71 | 71 |
|
@@ -488,7 +488,7 @@ def set_interpolation(self, s):
|
488 | 488 | if s is None:
|
489 | 489 | s = rcParams['image.interpolation']
|
490 | 490 | s = s.lower()
|
491 |
| - if s not in __interpd: |
| 491 | + if s not in _interpd_: |
492 | 492 | raise ValueError('Illegal interpolation string')
|
493 | 493 | self._interpolation = s
|
494 | 494 | self.stale = True
|
@@ -622,7 +622,7 @@ def make_image(self, magnification=1.0):
|
622 | 622 | numrows, numcols = im.get_size()
|
623 | 623 | if numrows < 1 or numcols < 1: # out of range
|
624 | 624 | return None
|
625 |
| - im.set_interpolation(__interpd[self._interpolation]) |
| 625 | + im.set_interpolation(_interpd_[self._interpolation]) |
626 | 626 |
|
627 | 627 | im.set_resample(self._resample)
|
628 | 628 |
|
@@ -765,7 +765,7 @@ def make_image(self, magnification=1.0):
|
765 | 765 | im = _image.pcolor(self._Ax, self._Ay, A,
|
766 | 766 | int(height), int(width),
|
767 | 767 | (x0, x0+v_width, y0, y0+v_height),
|
768 |
| - __interpd[self._interpolation]) |
| 768 | + _interpd_[self._interpolation]) |
769 | 769 |
|
770 | 770 | fc = self.axes.patch.get_facecolor()
|
771 | 771 | bg = mcolors.colorConverter.to_rgba(fc, 0)
|
@@ -1191,7 +1191,7 @@ def make_image(self, renderer, magnification=1.0):
|
1191 | 1191 | # image input dimensions
|
1192 | 1192 | im.reset_matrix()
|
1193 | 1193 |
|
1194 |
| - im.set_interpolation(__interpd[self._interpolation]) |
| 1194 | + im.set_interpolation(_interpd_[self._interpolation]) |
1195 | 1195 |
|
1196 | 1196 | im.set_resample(self._resample)
|
1197 | 1197 |
|
|
0 commit comments