Line visual implementing Agg- and GL-based drawing modes.
vispy.visuals.line.line.
LineVisual
Bases: vispy.visuals.visual.CompoundVisual
vispy.visuals.visual.CompoundVisual
Line visual
Array of shape (…, 2) or (…, 3) specifying vertex coordinates.
The color to use when drawing the line. If an array is given, it must be of shape (…, 4) and provide one rgba color per vertex. Can also be a colormap name, or appropriate Function.
The width of the line in px. Line widths > 1px are only guaranteed to work when using ‘agg’ method.
Determines which vertices are connected by lines.
“strip” causes the line to be drawn with each vertex connected to the next. “segments” causes each pair of vertices to draw an independent line segment numpy arrays specify the exact set of segment pairs to connect.
“strip” causes the line to be drawn with each vertex connected to the next.
“segments” causes each pair of vertices to draw an independent line segment
numpy arrays specify the exact set of segment pairs to connect.
Mode to use for drawing.
“agg” uses anti-grain geometry to draw nicely antialiased lines with proper joins and endcaps. “gl” uses OpenGL’s built-in line rendering. This is much faster, but produces much lower-quality results and is not guaranteed to obey the requested line width or join/endcap styles.
“agg” uses anti-grain geometry to draw nicely antialiased lines with proper joins and endcaps.
“gl” uses OpenGL’s built-in line rendering. This is much faster, but produces much lower-quality results and is not guaranteed to obey the requested line width or join/endcap styles.
Enables or disables antialiasing. For method=’gl’, this specifies whether to use GL’s line smoothing, which may be unavailable or inconsistent on some platforms.
antialias
color
connect
method
The current drawing method
pos
set_data
Set the data used to draw this visual.
The color to use when drawing the line. If an array is given, it must be of shape (…, 4) and provide one rgba color per vertex.
The width of the line in px. Line widths < 1 px will be rounded up to 1 px when using the ‘gl’ method.
“strip” causes the line to be drawn with each vertex connected to the next. “segments” causes each pair of vertices to draw an independent line segment int numpy arrays specify the exact set of segment pairs to connect. bool numpy arrays specify which _adjacent_ pairs to connect.
int numpy arrays specify the exact set of segment pairs to connect.
bool numpy arrays specify which _adjacent_ pairs to connect.
width
vec3to4
TODO:
Agg support is very minimal; needs attention.
Optimization–avoid creating new buffers, avoid triggering program recompile.