pwtools.mpl.Plot.collect_legends

Plot.collect_legends(axnames=['ax'])[source]

If self has more then one axis object attached, then collect legends from all axes specified in axnames. Useful for handling legend entries of lines on differend axes (in case of twinx, for instance).

Parameters:

axnames (sequence of strings) –

Returns:

  • tuple of lines and labels – ([line1, line2, …], [‘foo’, ‘bar’, …])

  • where lines and labels are taken from all axes. Use this as input for

  • any axis’s legend() method.