Skip to content

Label

Label(
text='',
origin=(0, 0),
anchor='NW',
rotation=0,
scaling=1,
x_reflection=False,
)

Text label.

Args

  • text (str): Label text.
  • origin (Sequence[float] | complex): Label position.
  • anchor (Literal[“NW”, “N”, “NE”, “W”, “O”, “E”, “SW”, “S”, “SE”]): Anchor point for text alignment.
  • rotation (float): Rotation (in degrees) of this label.
  • scaling (float): Label scaling factor.
  • x_reflection (bool): Flag controlling mirroring across the x axis.
MethodDescription
add_gds_propertyAdd a custom property to this object compatible with GDSII files.
copyCreate a copy of this label.
mirrorMirror this label.
rotateRotate this label around a specific center.
scaleScale this label.
transformApply a transformation to this label:
translateTranslate this label.

add_gds_property(attribute, value)

Add a custom property to this object compatible with GDSII files.

Args

  • attribute (int): Property number.
  • value (str): Property value.

copy(self)

Create a copy of this label.

Returns

Label: New copy.

mirror(self, axis_endpoint=(1, 0), axis_origin=(0, 0))

Mirror this label.

Args

  • axis_endpoint (Sequence[float] | complex): Mirror axis endpoint.
  • axis_origin (Sequence[float] | complex): Mirror axis origin.

Returns

Label: This label.

rotate(self, rotation, center=(0, 0))

Rotate this label around a specific center.

Args

  • rotation (float): Rotation angle in degrees.
  • center (Sequence[float] | complex): Center of rotation.

Returns

Label: This label.

scale(self, scaling, center=(0, 0))

Scale this label.

Args

  • scaling (float): Scaling factor.
  • center (Sequence[float] | complex): Center of scaling.

Returns

Label: This label.

transform(
self, translation=(0, 0), rotation=0, scaling=1, x_reflection=False
)

Apply a transformation to this label: self = translate(rotate(mirror(scale(self))))

Args

  • translation (Sequence[float], complex): Translation vector.
  • rotation (float): Rotation angle in degrees.
  • scaling (float): Magnification factor.
  • x_reflection (bool): Mirror across the horizontal axis.

Returns

Label: This label.

translate(self, translation)

Translate this label.

Args

  • translation (Sequence[float]): Translation vector.

Returns

Label: This label.

AttributeDescription
anchorLiteral[‘NW’, ‘N’, ‘NE’, ‘W’, ‘O’, ‘E’, ‘SW’, ‘S’, ‘SE’]: Label anchor.
originndarray: Label origin.
propertiesProperties: Object properties.
rotationfloat: Label rotation.
scalingfloat: Label scaling.
textstr: Label text.
x_reflectionLabel x_reflection.

Literal[‘NW’, ‘N’, ‘NE’, ‘W’, ‘O’, ‘E’, ‘SW’, ‘S’, ‘SE’]: Label anchor.

ndarray: Label origin.

Properties: Object properties.

float: Label rotation.

float: Label scaling.

str: Label text.

Label x_reflection.