Registry / data / cycler

cycler

JSON →
library0.12.1pypypi✓ verified 26d ago

Cycler is a Python library for creating composable style cycles, allowing for flexible and reusable combinations of style properties. The current version is 0.12.1, released on a regular basis, with the latest release on March 28, 2026.

pip install cycler
INSTALL
IMPORT
SIG · CYCLER
C
cycler
datapythonv0.12.1
Install
1.7s avg
Import
12ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.12.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.012s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cycler
from cycler import cycler
Importing the 'cycler' function from the 'cycler' module.
Cycler
from cycler import Cycler
Importing the 'Cycler' class from the 'cycler' module.

This example demonstrates how to use Cycler to create a custom style cycle for plotting multiple sine curves with different colors and line styles.

from cycler import cycler import matplotlib.pyplot as plt import numpy as np # Generate sample data x = np.linspace(0, 2 * np.pi, 50) offsets = np.linspace(0, 2 * np.pi, 4, endpoint=False) yy = np.transpose([np.sin(x + phi) for phi in offsets]) # Create a cycler object style_cycler = cycler(color=['r', 'g', 'b', 'c'], linestyle=['-', '--', '-.']) # Apply the cycler to the current axes plt.gca().set_prop_cycle(style_cycler) # Plot the data for y in yy: plt.plot(x, y) plt.show()
Debug
Known issues
breakingCycler 0.12.1 introduces changes to the 'Cycler' class constructor, which may affect existing code that relies on the previous constructor signature.
fix
Update the constructor calls to match the new signature as per the latest documentation.
affects: 0.12.1
gotchaWhen using Cycler with Matplotlib, ensure that the 'cycler' module is imported before creating plots to avoid potential conflicts with Matplotlib's default style cycle.
fix
Import 'cycler' before importing 'matplotlib.pyplot' to ensure the custom style cycle is applied correctly.
affects: All
breakingThe 'matplotlib' module is not found, preventing the script from importing it. This typically means the package is not installed in the current Python environment.
fix
Install the 'matplotlib' package using pip: `pip install matplotlib`
affects: All
breakingThe 'matplotlib' module was not found, leading to a ModuleNotFoundError. This indicates that the 'matplotlib' package is not installed or not available in the current Python environment.
fix
Install the 'matplotlib' package using pip: `pip install matplotlib`. Ensure that your environment has all necessary dependencies installed before running the script.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'cycler'
The `cycler` package is not installed in the Python environment, or the environment where it's installed is not the one being used.
fix
Install the `cycler` library using pip: `pip install cycler`
AttributeError: 'Cycler' object has no attribute 'change_key'
This error typically occurs when an older version of the `cycler` library is used with a newer version of `matplotlib` that expects a method (`change_key`) which is not present in the older `cycler` version.
fix
Upgrade the `cycler` library to its latest version: `pip install --upgrade cycler`
NameError: name 'cycler' is not defined
The `cycler` object or class was used in a context (e.g., `matplotlib.rcParams`) without being explicitly imported from the `cycler` module.
fix
Add `from cycler import cycler` at the top of your Python script or relevant code block.
ImportError: cannot import name 'Cycler' from 'cycler'
This usually indicates a version mismatch where the `Cycler` class might not be directly exposed at the top level of the `cycler` package in older versions, or there's a conflict with other installed packages.
fix
Ensure `cycler` is up-to-date: `pip install --upgrade cycler`. If the issue persists, try importing `cycler` as a module and accessing its attributes: `import cycler` then `cycler.Cycler()`.
Upgrade
Version history
0.12.1latest on PyPI · released Oct 7, 2023
Audit
Dependencies
matplotlibrequiredCycler is a dependency of Matplotlib, a popular plotting library.
Agent activity
27 hits · last 30 days
node
24
OpenAI (training)
1
Resources
cycler — pip install cycler · libregistry