cls_BaseFigure - almarklein/visvis GitHub Wiki

Inherits from _BaseFigure.

Abstract class representing the root of all wibjects.

A Figure is a wrapper around the OpenGL widget in which it is drawn; this way different backends are possible. Each backend inherits this class and implements the required methods and makes sure all GUI events are translated to visvis events.

Since the figure represents the OpenGl context and is the root of the visualization tree; a Figure Wibject does not have a parent.

A Figure can be created with the function vv.figure() or vv.gcf().

The BaseFigure class implements the following properties:
currentAxes, enableUserInteraction, eventAfterDraw, eventClose, mousepos, nr, parent, position, relativeFontSize, title, underMouse

The BaseFigure class implements the following methods:
Clear, Destroy, Draw, DrawNow, MakeCurrent, OnDraw

Properties

Get/Set the currently active axes of this figure. Returns None if no axes are present.

Whether to allow user interaction. The default is True. This property can be set to False to improve performance (expensive calls to glDrawPixels can be omitted).

Fired after each drawing pass.

Fired when the figure is closed.

Get the position of the mouse in figure coordinates.

Get the number (id) of this figure.

The parent of a figure always returns None and cannot be set.

The position for the figure works a bit different than for other wibjects: it only works with absolute values and it represents the position on screen or the position in the parent widget in an application.

The (global) relative font size; all texts in this figure are scaled by this amount. This is intended to (slighly) increase or descrease font size in the figure for publication purposes.

Get/Set the title of the figure. If an empty string or None, will display "Figure X", with X the figure nr.

Get the object currently under the mouse. Can be None.

Methods

Clear the figure, removing all wibjects inside it and clearing all callbacks.

Close the figure and clean up all children.

Draw the figure within 10 ms (if the events are handled). Multiple calls in a short amount of time will result in only one redraw.

Draw the figure right now and let the GUI toolkit process its events. Call this from time to time if you want to update your figure while running some algorithm, and let the figure stay responsive.

Make this the current figure. Equivalent to "vv.figure(fig.nr)".

Perform the actual drawing. Called by the GUI toolkit paint event handler. Users should not call this method, but use Draw() or DrawNow().

⚠️ **GitHub.com Fallback** ⚠️