Skip to content

pyglplot.line

A simple xy line plotter.

Parameters:

Name Type Description Default
line_size

number of points in the line

100
line_number

number of lines

1
width

window width

1280
height

window height

800
title

window title

'pyglplot'
context_api

OpenGL windowing method: "native", "egl", "osmesa", or "auto"

'native'

run(update_function=_update_empty)

refresh the window and run the update function. This function will block the main thread until the window is closed.

Parameters:

Name Type Description Default
update_function

function to run at each refresh

_update_empty

Returns:

Type Description

None

update_color(index_line, rgb)

update the color of a line

Parameters:

Name Type Description Default
index_line int

index of the line to update

required
rgb np.ndarray

color of the line in numpy array of (3,) with values between 0 and 255. e.g. np.array([255, 0, 0]) for red

required

Returns:

Type Description
None

None

update_line_x(index_line, x)

update the x values of a line

Parameters:

Name Type Description Default
index_line int

index of the line to update

required
x np.ndarray

x values of the line in format of numpy array (x0, x1, x2, ...)

required

Returns:

Type Description
None

None

update_line_xy(index_line, x, y)

update the x and y values of a line

Parameters:

Name Type Description Default
index_line int

index of the line to update

required
x np.ndarray

x values of the line in format of numpy array (x0, x1, x2, ...)

required
y np.ndarray

y values of the line in format of numpy array (y0, y1, y2, ...)

required

update_line_y(index_line, y)

update the y values of a line

Parameters:

Name Type Description Default
index_line int

index of the line to update

required
y np.ndarray

y values of the line in format of numpy array (y0, y1, y2, ...)

required

Returns:

Type Description
None

None