adding legends legends are another critical element for identifying plot elements there are couple of ways to add one the easiest is to pass the label argument when adding each piece of the plotin [ ]fig plt figure()ax fig add_subplot( in [ ]ax plot(randn( cumsum()' 'label='one'out[ ][in [ ]ax plot(randn( cumsum()' --'label='two'out[ ][in [ ]ax plot(randn( cumsum()' 'label='three'out[ ][once you've done thisyou can either call ax legend(or plt legend(to automatically create legendin [ ]ax legend(loc='best'see figure - the loc tells matplotlib where to place the plot if you aren' picky 'bestis good optionas it will choose location that is most out of the way to exclude one or more elements from the legendpass no label or label='_nolegend_annotations and drawing on subplot in addition to the standard plot typesyou may wish to draw your own plot annotationswhich could consist of textarrowsor other shapes plotting and visualization www it-ebooks info