expyfun.visual.Circle#

class expyfun.visual.Circle(ec, radius=1, pos=(0, 0), units='norm', n_edges=200, fill_color='white', line_color=None, line_width=1.0)[source]#

A circle or ellipse.

Parameters:
ecinstance of ExperimentController

Parent EC.

radiusfloat | array-like

Radius of the circle. Can be array-like with two elements to make an ellipse.

posarray-like

2-element array-like with X, Y center positions.

unitsstr

Units to use. These will apply to all spatial aspects of the drawing. shape e.g. size, position. See check_units for options.

n_edgesint

Number of edges to use (must be >= 4) to approximate a circle.

fill_colormatplotlib Color | None

Color to fill with. None is transparent.

line_colormatplotlib Color | None

Color of the border line. None is transparent.

line_widthfloat

Line width in pixels.

Methods

draw()

Draw the object to the display buffer.

set_fill_color(fill_color)

Set the object color

set_line_color(line_color)

Set the object color

set_line_width(line_width)

Set the line width in pixels

set_pos(pos[, units])

Set the position and radius of the circle

set_radius(radius[, units])

Set the position and radius of the circle

Returns:
circleinstance of Circle

The circle object.

draw()[source]#

Draw the object to the display buffer.

set_fill_color(fill_color)[source]#

Set the object color

Parameters:
fill_colormatplotlib Color | None

The fill color. Use None for no fill.

set_line_color(line_color)[source]#

Set the object color

Parameters:
line_colormatplotlib Color | None

The fill color. Use None for no fill.

set_line_width(line_width)[source]#

Set the line width in pixels

Parameters:
line_widthfloat

The line width. Must be given in pixels. Due to OpenGL limitations, it must be 0.0 <= line_width <= 10.0.

set_pos(pos, units='norm')[source]#

Set the position and radius of the circle

Parameters:
posarray-like

X, Y center of the circle.

unitsstr

Units to use. See check_units for options.

set_radius(radius, units='norm')[source]#

Set the position and radius of the circle

Parameters:
radiusarray-like | float

X- and Y-direction extents (radii) of the circle / ellipse. A single value (float) will be replicated for both directions.

unitsstr

Units to use. See check_units for options.

Examples using expyfun.visual.Circle#

Experiment drawing methods

Experiment drawing methods

Experiment with eye-tracking

Experiment with eye-tracking

Use joystick controls

Use joystick controls

Mouse click demo

Mouse click demo

A-V sync test

A-V sync test