More matplotlib color fun with cycler package
There’s cycler
, a package:
- Composable cycles — cycler 0.11.0 documentation
- A tutorial for matplotlib: Styling with cycler — Matplotlib 3.7.1 documentation
It returns cycles of dicts, finite or infinite:
from cycler import cycler
# list of colors
pal = sns.color_palette("Paired")
# `cycler` is a finite cycle, cycler() is an infinite
cols = iter(cycler(color=pal)())
# every time you need a color
my_color = next(cols)
Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus