Legend

class understand.Legend

Bases: object

Graph plugin legend object

Optionally provide a legend for your graph. Retrieve the legend from the root Graph object with legend. In init, define entries. If you need to update entries later, use set. Legends are only shown from inside the Understand Gui. Legend visibility is controlled from the graph toolbar.

Methods Summary

define

Define legend entries.

set

Set legend entry attributes.

Methods Documentation

define(name, shape, label[, fore[, back[, row, column]]]) None

Define legend entries.

Parameters:
  • name (str) – an internal entry name. Use this for the set argument if this entry is updated later.

  • shape (str) – the shape to draw in the legend. See below for available shapes.

  • label (str) – the text that will appear in the legend

  • fore (str or None) – optional, the foreground color

  • back (str or None) – optional the background color

  • row (int or None) – optional, the grid row within the legend where this entry should appear.

  • column (int or None) – optional, the grid column within the legend where this entry should appear.

Return type:

None

If row and columns are provided, they should be provided for all entries. Available shapes are:

  • rectangle

  • roundedrect

  • ellipse / circle

  • arrow

  • dasharrow / dashedarrow

  • dotarrow / dottedarrow

  • line

  • dashline / dashedline

  • dotline / dottedline

  • none

set(name, attr, value) None

Set legend entry attributes.

Parameters:
  • name (str) – the name provided to define

  • attr (str) – the attribute to change

  • value (str) – the new value

Return type:

None

Possible attribute names are:

  • shape

  • desc / description

  • fore / color

  • back / fillcolor

  • row

  • column