Skip to content

Commit 943ee29

Browse files
committed
DOC: add a bit more context
1 parent 0710775 commit 943ee29

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/source/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,17 @@ or repeating
273273
loop_cy_iter = cyl()
274274
dd_loop = defaultdict(lambda : next(loop_cy_iter))
275275
276+
This can be helpful when plotting complex data which has both a classification
277+
and a label ::
278+
279+
finite_cy_iter = iter(cyl)
280+
styles = defaultdict(lambda : next(finite_cy_iter))
281+
for group, label, data in DataSet:
282+
ax.plot(data, label=label, **styles[group])
283+
284+
which will result in every ``data`` with the same ``group`` being plotted with
285+
the same style.
286+
276287
Exceptions
277288
----------
278289

0 commit comments

Comments
 (0)