Common properties

Various object-types have some subset of the below properties.

property is_visible: bool

(Get/set) Whether the object is visible in the construction.

property is_independent: bool

(Get-only) Whether the object is independent — if the object depends on another GeoGebra object, then it is not independent. E.g., the code

p1 = Point(3, 4)
x = Number(-2)
p2 = Point(x, 6)
print("p1 indpt?", p1.is_independent)
print("p2 indpt?", p2.is_independent)

will print

p1 indpt? True
p2 indpt? False
property size

(Get/set) An integer from 1 (smallest) to 9 (biggest) giving the size of the object.

property color

(Get/set) A string describing the colour of the object. Can be a named colour (from this list), e.g., "cornflowerblue", or a three- or six-hex-digit RGB code, e.g., "#8043a9". When read, gives a six-hex-digit RGB code using uppercase letters for digits AF.

property color_floats

(Get-only) A three-element tuple of floats, each in the range [0.0, 1.0], for the red, green, and blue components of the object’s colour.

property line_thickness: int

(Get/set) How thick the line is, from 1 (thinnest) to 9 (thickest).

property label_visible: bool

(Get/set) Whether the object’s label is shown in the construction.

property label_style: int

(Get/set) What style of label to show for the object:

  • 0 — Name only

  • 1 — Name and value

  • 2 — Value only

  • 3 — Caption

property caption: string

(Get/set) The object’s caption. Note that setting the caption property also sets the label_style property to 3, to ensure the caption is shown.

property opacity

(Get/set) How opaque the object is, from 0 for totally transparent, to 1 for totally opaque.

Properties intended for internal use

property _ggb_type: str

(Get-only) The GeoGebra “object type” for the object. E.g., point for a Point.

property _ggb_exists: bool

(Get-only) Whether the underlying GeoGebra object referred to by this Python wrapper exists.

Caution

Currently, support for deleting GeoGebra objects is undocumented and experimental, so it is unlikely that your program will need to use the _ggb_exists property.