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 962a2d7

Browse filesBrowse files
committed
Update docs on cycler function
1 parent bd8a1e6 commit 962a2d7
Copy full SHA for 962a2d7

File tree

Expand file treeCollapse file tree

1 file changed

+22
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-7
lines changed

‎lib/matplotlib/rcsetup.py

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+22-7Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,11 @@ def cycler(*args, **kwargs):
722722
Creates a :class:`cycler.Cycler` object much like :func:`cycler.cycler`,
723723
but includes input validation.
724724
725-
cycler(arg)
726-
cycler(label, itr)
727-
cycler(label1=itr1[, label2=itr2[, ...]])
725+
Call signatures::
726+
727+
cycler(cycler)
728+
cycler(label, values)
729+
cycler(label=values[, label2=values2[, ...]])
728730
729731
Form 1 simply copies a given `Cycler` object.
730732
@@ -736,15 +738,15 @@ def cycler(*args, **kwargs):
736738
737739
Parameters
738740
----------
739-
arg : Cycler
741+
cycler : Cycler
740742
Copy constructor for Cycler.
741743
742-
label : name
743-
The property key. Must be a valid `Artist` property.
744+
label : str
745+
The property key. Must be a valid `.Artist` property.
744746
For example, 'color' or 'linestyle'. Aliases are allowed,
745747
such as 'c' for 'color' and 'lw' for 'linewidth'.
746748
747-
itr : iterable
749+
values : iterable
748750
Finite-length iterable of the property values. These values
749751
are validated and will raise a ValueError if invalid.
750752
@@ -753,6 +755,19 @@ def cycler(*args, **kwargs):
753755
cycler : Cycler
754756
New :class:`cycler.Cycler` for the given properties
755757
758+
Examples
759+
--------
760+
Creating a cycler for a single property:
761+
762+
>>> c = cycler(color=['red', 'green', 'blue']) # or
763+
>>> c = cycler('color', ['red', 'green', 'blue'])
764+
765+
Creating a cycler for simultaneously cycling over multiple properties
766+
(e.g. red circle, green plus, blue cross):
767+
768+
>>> c = cycler(color=['red', 'green', 'blue'],
769+
... marker=['o', '+', 'x'])
770+
756771
"""
757772
if args and kwargs:
758773
raise TypeError("cycler() can only accept positional OR keyword "

0 commit comments

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