vispy.visuals.markers module#

Marker Visual and shader definitions.

class vispy.visuals.markers.MarkersVisual(scaling='fixed', alpha=1, antialias=1, spherical=False, light_color='white', light_position=(1, -1, 1), light_ambient=0.3, **kwargs)#

Bases: Visual

Visual displaying marker symbols.

Parameters:
posarray

The array of locations to display each symbol.

sizefloat or array

The symbol size in screen (or data, if scaling is on) px.

edge_widthfloat or array or None

The width of the symbol outline in screen (or data, if scaling is on) px. Defaults to 1.0 if None or not provided and edge_width_rel is not provided.

edge_width_relfloat or array or None

The width as a fraction of marker size. Can not be specified along with edge_width. A ValueError will be raised if both are provided.

edge_colorColor | ColorArray

The color used to draw each symbol outline.

face_colorColor | ColorArray

The color used to draw each symbol interior.

symbolstr or array

The style of symbol used to draw each marker (see Notes).

scalingstr | bool

Scaling method of individual markers. If set to “fixed” (default) then no scaling is done and markers will always be the same number of pixels on the screen. If set to “scene” then the chain of transforms from the Visual’s transform to the transform mapping to the OpenGL framebuffer are used to scaling the marker. This has the effect of the marker staying the same size in the “scene” coordinate space and changing size as the visualization is zoomed in and out. If set to “visual” the marker is scaled only using the transform of the Visual and not the rest of the scene/camera. This means that something like a camera changing the view will not affect the size of the marker, but the user can still scale it using the Visual’s transform. For backwards compatibility this can be set to the boolean False for “fixed” or True for “scene”.

alphafloat

The opacity level of the visual.

antialiasfloat

Antialiasing amount (in px).

sphericalbool

Whether to add a spherical effect on the marker using lighting.

light_colorColor | ColorArray

The color of the light used to create the spherical effect.

light_positionarray

The coordinates of the light used to create the spherical effect.

light_ambientfloat

The amount of ambient light used to create the spherical effect.

Notes

Allowed style strings are: disc, arrow, ring, clobber, square, diamond, vbar, hbar, cross, tailed_arrow, x, triangle_up, triangle_down, and star.

property alpha#

The opacity level of the visual.

property antialias#

Antialiasing amount (in px).

property light_ambient#

The amount of ambient light used to create the spherical effect.

property light_color#

The color of the light used to create the spherical effect.

property light_position#

The coordinates of the light used to create the spherical effect.

property scaling#

If set to True, marker scales when rezooming.

set_data(pos=None, size=10.0, edge_width=None, edge_width_rel=None, edge_color='black', face_color='white', symbol='o')#

Set the data used to display this visual.

Parameters:
posarray

The array of locations to display each symbol.

sizefloat or array

The symbol size in screen (or data, if scaling is on) px.

edge_widthfloat or array or None

The width of the symbol outline in screen (or data, if scaling is on) px. Defaults to 1.0 if None or not provided and edge_width_rel is not

provided.
edge_width_relfloat or array or None

The width as a fraction of marker size. Can not be specified along with edge_width. A ValueError will be raised if both are provided.

edge_colorColor | ColorArray

The color used to draw each symbol outline.

face_colorColor | ColorArray

The color used to draw each symbol interior.

symbolstr or array

The style of symbol used to draw each marker (see Notes).

property spherical#

Whether to add a spherical effect on the marker using lighting.

property symbol#
property symbols#