Previous topic

BufferImageStim

Next topic

CustomMouse

This Page

Quick links

Circle

class psychopy.visual.Circle(win, radius=0.5, edges=32, **kwargs)

Creates a Circle with a given radius as a special case of a ~psychopy.visual.ShapeStim

(New in version 1.72.00)

Circle accepts all input parameters that ~psychopy.visual.ShapeStim accept, except for vertices and closeShape.

Parameters :
win :

A Window object (required)

edges : float or int (default=32)

Specifies the resolution of the polygon that is approximating the circle.

radius : float, int, tuple, list or 2x1 array

Radius of the Circle (distance from the center to the corners). If radius is a 2-tuple or list, the values will be interpreted as semi-major and semi-minor radii of an ellipse.

draw(win=None)

Draw the stimulus in its relevant window. You must call this method after every MyWin.flip() if you want the stimulus to appear on that frame and then update the screen again.

setAutoDraw(val)

Add or remove a stimulus from the list of stimuli that will be automatically drawn on each flip

Parameters :
  • val: True/False

    True to add the stimulus to the draw list, False to remove it

setAutoLog(val=True)

Turn on (or off) autoLogging for this stimulus.

Parameters :
  • val: True (default) or False
setColor(color, colorSpace=None, operation='')

For ShapeStim use setLineColor() or setFillColor()

setContr(newContr, operation='')

Set the contrast of the stimulus

setDKL(newDKL, operation='')

DEPRECATED since v1.60.05: Please use setColor

setDepth(newDepth, operation='')
setFillColor(color, colorSpace=None, operation='')

Sets the color of the shape fill. See PatchStim.setColor() for further details of how to use this function.

Note that shapes where some vertices point inwards will usually not ‘fill’ correctly.

setFillRGB(value, operation='')

DEPRECATED since v1.60.05: Please use setFillColor()

setLMS(newLMS, operation='')

DEPRECATED since v1.60.05: Please use setColor

setLineColor(color, colorSpace=None, operation='')

Sets the color of the shape edge. See PatchStim.setColor() for further details of how to use this function.

setLineRGB(value, operation='')

DEPRECATED since v1.60.05: Please use setLineColor()

setOpacity(newOpacity, operation='')
setOri(newOri, operation='')

Set the stimulus orientation in degrees

setPos(newPos, operation='', units=None)

Set the stimulus position in the specified (or inherited) units

setRGB(newRGB, operation='')

DEPRECATED since v1.60.05: Please use setColor

setRadius(radius)

Changes the radius of the Polygon. If radius is a 2-tuple or list, the values will be interpreted as semi-major and semi-minor radii of an ellipse.

setSize(value, operation='')

Sets the size of the shape. Size is independent of the units of shape and will simply scale the shape’s vertices by the factor given. Use a tuple or list of two values to scale asymmetrically.

setUseShaders(val=True)

Set this stimulus to use shaders if possible.

setVertices(value=None, operation='')

Set the xy values of the vertices (relative to the centre of the field). Values should be:

  • an array/list of Nx2 coordinates.