Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b252fe7

Browse files
committed
Stupid, don't user double underscore because of mangling
1 parent 4319fde commit b252fe7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/matplotlib/image.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import matplotlib.transforms as mtransforms
3636

3737
# map interpolation strings to module constants
38-
__interpd = {
38+
_interpd_ = {
3939
'none': _image.NEAREST, # fall back to nearest when not supported
4040
'nearest': _image.NEAREST,
4141
'bilinear': _image.BILINEAR,
@@ -57,15 +57,15 @@
5757
}
5858

5959

60-
interpolations_names = list(six.iterkeys(__interpd))
60+
interpolations_names = list(six.iterkeys(_interpd_))
6161

6262
class _AxesImageBase(martist.Artist, cm.ScalarMappable):
6363
zorder = 0
6464

6565
# the 3 following keys seem to be unused now, keep it for backward compat just in case.
66-
_interpd = __interpd
66+
_interpd = _interpd_
6767
# 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_)])
6969
iterpnames = interpolations_names
7070
# <end unused keys>
7171

@@ -488,7 +488,7 @@ def set_interpolation(self, s):
488488
if s is None:
489489
s = rcParams['image.interpolation']
490490
s = s.lower()
491-
if s not in __interpd:
491+
if s not in _interpd_:
492492
raise ValueError('Illegal interpolation string')
493493
self._interpolation = s
494494
self.stale = True
@@ -622,7 +622,7 @@ def make_image(self, magnification=1.0):
622622
numrows, numcols = im.get_size()
623623
if numrows < 1 or numcols < 1: # out of range
624624
return None
625-
im.set_interpolation(__interpd[self._interpolation])
625+
im.set_interpolation(_interpd_[self._interpolation])
626626

627627
im.set_resample(self._resample)
628628

@@ -765,7 +765,7 @@ def make_image(self, magnification=1.0):
765765
im = _image.pcolor(self._Ax, self._Ay, A,
766766
int(height), int(width),
767767
(x0, x0+v_width, y0, y0+v_height),
768-
__interpd[self._interpolation])
768+
_interpd_[self._interpolation])
769769

770770
fc = self.axes.patch.get_facecolor()
771771
bg = mcolors.colorConverter.to_rgba(fc, 0)
@@ -1191,7 +1191,7 @@ def make_image(self, renderer, magnification=1.0):
11911191
# image input dimensions
11921192
im.reset_matrix()
11931193

1194-
im.set_interpolation(__interpd[self._interpolation])
1194+
im.set_interpolation(_interpd_[self._interpolation])
11951195

11961196
im.set_resample(self._resample)
11971197

0 commit comments

Comments
 (0)