MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / cycler

Function cycler

lib/matplotlib/rcsetup.py:733–815  ·  view source on GitHub ↗

Create a `~cycler.Cycler` object much like :func:`cycler.cycler`, but includes input validation. Call signatures:: cycler(cycler) cycler(label=values, label2=values2, ...) cycler(label, values) Form 1 copies a given `~cycler.Cycler` object. Form 2 creates a

(*args, **kwargs)

Source from the content-addressed store, hash-verified

731
732
733def cycler(*args, **kwargs):
734 """
735 Create a `~cycler.Cycler` object much like :func:`cycler.cycler`,
736 but includes input validation.
737
738 Call signatures::
739
740 cycler(cycler)
741 cycler(label=values, label2=values2, ...)
742 cycler(label, values)
743
744 Form 1 copies a given `~cycler.Cycler` object.
745
746 Form 2 creates a `~cycler.Cycler` which cycles over one or more
747 properties simultaneously. If multiple properties are given, their
748 value lists must have the same length.
749
750 Form 3 creates a `~cycler.Cycler` for a single property. This form
751 exists for compatibility with the original cycler. Its use is
752 discouraged in favor of the kwarg form, i.e. ``cycler(label=values)``.
753
754 Parameters
755 ----------
756 cycler : Cycler
757 Copy constructor for Cycler.
758
759 label : str
760 The property key. Must be a valid `.Artist` property.
761 For example, 'color' or 'linestyle'. Aliases are allowed,
762 such as 'c' for 'color' and 'lw' for 'linewidth'.
763
764 values : iterable
765 Finite-length iterable of the property values. These values
766 are validated and will raise a ValueError if invalid.
767
768 Returns
769 -------
770 Cycler
771 A new :class:`~cycler.Cycler` for the given properties.
772
773 Examples
774 --------
775 Creating a cycler for a single property:
776
777 >>> c = cycler(color=['red', 'green', 'blue'])
778
779 Creating a cycler for simultaneously cycling over multiple properties
780 (e.g. red circle, green plus, blue cross):
781
782 >>> c = cycler(color=['red', 'green', 'blue'],
783 ... marker=['o', '+', 'x'])
784
785 """
786 if args and kwargs:
787 raise TypeError("cycler() can only accept positional OR keyword "
788 "arguments -- not both.")
789 elif not args and not kwargs:
790 raise TypeError("cycler() must have positional OR keyword arguments")

Callers 15

set_prop_cycleMethod · 0.90
test_cnFunction · 0.90
custom_legends.pyFile · 0.90
_expand_text_propsFunction · 0.85
rcsetup.pyFile · 0.85
test_colorcycle_basicFunction · 0.85
test_marker_cycleFunction · 0.85
test_valid_marker_cyclesFunction · 0.85
test_fillcycle_basicFunction · 0.85
test_fillcycle_ignoreFunction · 0.85
test_valid_input_formsFunction · 0.85

Calls 3

validate_cyclerFunction · 0.85
validatorFunction · 0.85
getMethod · 0.45

Tested by 14

test_cnFunction · 0.72
test_colorcycle_basicFunction · 0.68
test_marker_cycleFunction · 0.68
test_valid_marker_cyclesFunction · 0.68
test_fillcycle_basicFunction · 0.68
test_fillcycle_ignoreFunction · 0.68
test_valid_input_formsFunction · 0.68
test_invalid_input_formsFunction · 0.68
generate_errorbar_inputsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…