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

Skip to content

Commit ca66d11

Browse files
committed
Remove unnecessary private method.
svn path=/trunk/matplotlib/; revision=8067
1 parent 8cd0afd commit ca66d11

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,7 @@ def __init__(self, axes, command='plot'):
150150
def set_color_cycle(self, clist=None):
151151
if clist is None:
152152
clist = rcParams['axes.color_cycle']
153-
self._colors = itertools.cycle(clist)
154-
155-
def _get_next_cycle_color(self):
156-
return self._colors.next()
153+
self.color_cycle = itertools.cycle(clist)
157154

158155
def __call__(self, *args, **kwargs):
159156

@@ -225,7 +222,7 @@ def _xy_from_xy(self, x, y):
225222
def _makeline(self, x, y, kw, kwargs):
226223
kw = kw.copy() # Don't modify the original kw.
227224
if not 'color' in kw:
228-
kw['color'] = self._get_next_cycle_color()
225+
kw['color'] = self.color_cycle.next()
229226
# (can't use setdefault because it always evaluates
230227
# its second argument)
231228
seg = mlines.Line2D(x, y,
@@ -239,7 +236,7 @@ def _makefill(self, x, y, kw, kwargs):
239236
try:
240237
facecolor = kw['color']
241238
except KeyError:
242-
facecolor = self._get_next_cycle_color()
239+
facecolor = self.color_cycle.next()
243240
seg = mpatches.Polygon(np.hstack(
244241
(x[:,np.newaxis],y[:,np.newaxis])),
245242
facecolor = facecolor,
@@ -4866,7 +4863,7 @@ def xywhere(xs, ys, mask):
48664863

48674864
if ecolor is None:
48684865
if l0 is None:
4869-
ecolor = self._get_lines._get_next_cycle_color()
4866+
ecolor = self._get_lines.color_cycle.next()
48704867
else:
48714868
ecolor = l0.get_color()
48724869

@@ -7163,7 +7160,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
71637160

71647161
if orientation == 'horizontal':
71657162
for m in n:
7166-
color = self._get_lines._get_next_cycle_color()
7163+
color = self._get_lines.color_cycle.next()
71677164
patch = self.barh(bins[:-1]+boffset, m, height=width,
71687165
left=bottom, align='center', log=log,
71697166
color=color)
@@ -7174,7 +7171,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
71747171
boffset += dw
71757172
elif orientation == 'vertical':
71767173
for m in n:
7177-
color = self._get_lines._get_next_cycle_color()
7174+
color = self._get_lines.color_cycle.next()
71787175
patch = self.bar(bins[:-1]+boffset, m, width=width,
71797176
bottom=bottom, align='center', log=log,
71807177
color=color)
@@ -7219,7 +7216,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
72197216
elif orientation != 'vertical':
72207217
raise ValueError, 'invalid orientation: %s' % orientation
72217218

7222-
color = self._get_lines._get_next_cycle_color()
7219+
color = self._get_lines.color_cycle.next()
72237220
if fill:
72247221
patches.append( self.fill(x, y,
72257222
closed=False, facecolor=color) )

0 commit comments

Comments
 (0)