pylbo.visualisation.legend_handler

Classes

LegendHandler

Main handler for legend stuff.

Functions

_get_legend_handles(legend)

Returns the legend handles.

Module Contents

pylbo.visualisation.legend_handler._get_legend_handles(legend)[source]

Returns the legend handles.

Parameters:

legend (Legend) – The matplotlib legend to use.

Returns:

handles – A list of handles.

Return type:

list

class pylbo.visualisation.legend_handler.LegendHandler(interactive)[source]

Main handler for legend stuff.

legend[source]

The matplotlib legend to use.

Type:

Legend

alpha_point[source]

Alpha value for non-hidden lines or points.

Type:

int, float

alpha_region[source]

Alpha value for non-hidden regions.

Type:

int, float

alpha_hidden[source]

Alpha value for hidden artists.

Type:

int, float

marker[source]

The marker to use for points.

Type:

markers

markersize[source]

Size of the marker.

Type:

int, float

pickradius[source]

Radius around pickable items so pickevents are triggered.

Type:

int, float

linewidth[source]

Width of drawn lines.

Type:

int, float

legend_properties[source]

Additional properties used when setting the legend.

Type:

dict

interactive[source]

If True, makes the legend interactive

Type:

bool

autoscale[source]

If True, will check if autoscale is needed when clicking the legend.

Type:

bool

legend = None[source]
alpha_point = 0.8[source]
alpha_region = 0.2[source]
alpha_hidden = 0.05[source]
marker = 'p'[source]
markersize = 64[source]
pickradius = 10[source]
linewidth = 2[source]
legend_properties[source]
interactive[source]
autoscale = False[source]
_drawn_items = [][source]
_legend_mapping[source]
_make_visible_by_default = False[source]
on_legend_pick(event)[source]

Determines what happens when the legend gets picked.

Parameters:

event (PickEvent) – The matplotlib pick event.

make_legend_pickable()[source]

Makes the legend pickable, only used if interactive.

add(item)[source]

Adds an item to the list of drawn items on the canvas.

Parameters:

item (object) – A single object, usually a return from the matplotlib plot or scatter methods.

_check_autoscaling()[source]

Checks if autoscaling is needed and if so, rescales the y-axis to the min-max value of the currently visible legend items.