Cycler
¶To inspect the values of the transposed Cycler
use
│ │ │ │ the Cycler.by_key
method:
In [36]: c_m.by_key()
│ │ │ │ Out[36]:
│ │ │ │ -{'color': ['r', 'r', 'g', 'g', 'b', 'b'],
│ │ │ │ - 'marker': ['s', 'o', 's', 'o', 's', 'o']}
│ │ │ │ +{'marker': ['s', 'o', 's', 'o', 's', 'o'],
│ │ │ │ + 'color': ['r', 'r', 'g', 'g', 'b', 'b']}
│ │ │ │
This dict
can be mutated and used to create a new Cycler
with
│ │ │ │ the updated values
In [37]: bk = c_m.by_key()
│ │ │ │
│ │ │ │ In [38]: bk['color'] = ['green'] * len(c_m)
│ │ │ │
│ │ │ │ In [39]: cycler(**bk)
│ │ │ │ -Out[39]: (cycler('color', ['green', 'green', 'green', 'green', 'green', 'green']) + cycler('marker', ['s', 'o', 's', 'o', 's', 'o']))
│ │ │ │ +Out[39]: (cycler('marker', ['s', 'o', 's', 'o', 's', 'o']) + cycler('color', ['green', 'green', 'green', 'green', 'green', 'green']))
│ │ │ │
We can use Cycler
instances to cycle over one or more kwarg
to
│ │ │ │ plot
: