madgui.plot.scene module

Plot base classes.

Classes

SceneNode()

An element of a figure.

SimpleArtist(name, artist, *args, **kwargs)

Delegates to draw function that returns a list of matplotlib artists.

SceneGraph(name[, items, figure])

A scene element that is composed of multiple elements.

ListView(name, model, fn, *args, **kwargs)

LineBundle

plot_line(ax, get_xydata, **style)

Plot a single line using an fetch function.

class madgui.plot.scene.LineBundle[source]

Bases: list

Methods

redraw()

remove(value)

Raises ValueError if the value is not present.

redraw()[source]
remove(value) → None – remove first occurrence of value.[source]

Raises ValueError if the value is not present.

class madgui.plot.scene.ListView(name, model, fn, *args, **kwargs)[source]

Bases: madgui.plot.scene.SceneGraph

Methods

destroy()

Cleanup all allocated ressources and disconnect signals.

destroy()[source]

Cleanup all allocated ressources and disconnect signals. Called when the SceneNode is removed from the graph and not needed anymore.

class madgui.plot.scene.SceneGraph(name, items=(), figure=None)[source]

Bases: madgui.plot.scene.SceneNode

A scene element that is composed of multiple elements.

Methods

add(*items)

Extend by several children.

destroy()

Cleanup all allocated ressources and disconnect signals.

extend(items)

Extend by several children.

insert(index, item)

on_clear_figure()

cleanup references to drawn state. Called when the figure was cleared,

pop(item)

Remove and hide one item (by value).

add(*items)[source]

Extend by several children.

destroy()[source]

Cleanup all allocated ressources and disconnect signals. Called when the SceneNode is removed from the graph and not needed anymore.

extend(items)[source]

Extend by several children.

insert(index, item)[source]
on_clear_figure()[source]

cleanup references to drawn state. Called when the figure was cleared, but the SceneNode is still part of the SceneGraph for next redraw.

pop(item)[source]

Remove and hide one item (by value).

class madgui.plot.scene.SceneNode[source]

Bases: object

An element of a figure.

Methods

destroy()

Cleanup all allocated ressources and disconnect signals.

draw_idle()

Let the canvas know that it has to redraw.

enable([enabled])

Enable/disable the element individually.

enabled()

Check whether this element should be drawn.

invalidate()

Mark drawn state as stale and redraw if needed.

node(name)

Find and return child node by name.

on_clear_figure()

cleanup references to drawn state. Called when the figure was cleared,

render([show])

Draw or remove this node (and all children) from the figure.

Attributes

figure

items

tuple() -> empty tuple

shown

bool(x) -> bool

destroy()[source]

Cleanup all allocated ressources and disconnect signals. Called when the SceneNode is removed from the graph and not needed anymore.

draw_idle()[source]

Let the canvas know that it has to redraw.

enable(enabled=True)[source]

Enable/disable the element individually.

enabled()[source]

Check whether this element should be drawn.

property figure
invalidate()[source]

Mark drawn state as stale and redraw if needed.

items = ()
lines = None
name = None
node(name)[source]

Find and return child node by name.

on_clear_figure()[source]

cleanup references to drawn state. Called when the figure was cleared, but the SceneNode is still part of the SceneGraph for next redraw.

parent = None
render(show=True)[source]

Draw or remove this node (and all children) from the figure.

shown = False
class madgui.plot.scene.SimpleArtist(name, artist, *args, **kwargs)[source]

Bases: madgui.plot.scene.SceneNode

Delegates to draw function that returns a list of matplotlib artists.

class madgui.plot.scene.plot_line(ax, get_xydata, **style)[source]

Bases: object

Plot a single line using an fetch function.

Methods

redraw()

remove()

redraw()[source]
remove()[source]