Skip to content

Implemented a new Style Cycle feature for Issue #2841 #4314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed all the suggestions made
  • Loading branch information
jasonliw93 committed Apr 9, 2015
commit f8287449f6953f8a3a2a4b019268ea3148a91de5
11 changes: 7 additions & 4 deletions lib/matplotlib/cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from matplotlib import rcParams


class Cycle:
class Cycle(object):

def __init__(self):
"""
Expand Down Expand Up @@ -36,15 +36,18 @@ def __setstate__(self, state):
for style in self._styles_list.keys():
self.set_cycle(style, self._styles_list[style])

def next(self, args={}):
def next(self, args=None):
"""
Returns the next set of line attributes for a line on the graph to use
*args* is an optional dictionary of style arguments
Styles that already exist in *args* will not be cycled through
"""
args = args.copy()
if args is None:
args = {}
else:
args = args.copy()
for style in self._styles.keys():
if self._styles[style] != None and style not in args:
if self._styles[style] is not None and style not in args:
args[style] = six.next(self._styles[style])
return args

Expand Down