lair.plotter.HandlerDashedLines#

class lair.plotter.HandlerDashedLines(marker_pad=0.3, numpoints=None, **kwargs)[source]#

Bases: HandlerLineCollection

Custom Handler for LineCollection instances.

https://stackoverflow.com/questions/31544489/two-line-styles-in-legend

There’s a potentially better version in the above link

This needs a new names and better documentation.

create_artists(legend, orig_handle, xdescent, ydescent, width, height, fontsize, trans)[source]#

Return the legend artists generated.

Parameters:
  • legend (~matplotlib.legend.Legend) – The legend for which these legend artists are being created.

  • orig_handle (~matplotlib.artist.Artist or similar) – The object for which these legend artists are being created.

  • xdescent (int) – The rectangle (xdescent, ydescent, width, height) that the legend artists being created should fit within.

  • ydescent (int) – The rectangle (xdescent, ydescent, width, height) that the legend artists being created should fit within.

  • width (int) – The rectangle (xdescent, ydescent, width, height) that the legend artists being created should fit within.

  • height (int) – The rectangle (xdescent, ydescent, width, height) that the legend artists being created should fit within.

  • fontsize (int) – The fontsize in pixels. The legend artists being created should be scaled according to the given fontsize.

  • trans (~matplotlib.transforms.Transform) – The transform that is applied to the legend artists being created. Typically from unit coordinates in the handler box to screen coordinates.