LabeledLine¶
Qualified name: manim.mobject.geometry.labeled.LabeledLine
- class LabeledLine(label, label_position=0.5, label_config=None, box_config=None, frame_config=None, *args, **kwargs)[source]¶
Bases:
LineConstructs a line containing a label box somewhere along its length.
- Parameters:
label (str | Tex | MathTex | Text) – Label that will be displayed on the line.
label_position (float) – A ratio in the range [0-1] to indicate the position of the label with respect to the length of the line. Default value is 0.5.
label_config (dict[str, Any] | None) – A dictionary containing the configuration for the label. This is only applied if
labelis of typestr.box_config (dict[str, Any] | None) – A dictionary containing the configuration for the background box.
frame_config (dict[str, Any] | None) –
A dictionary containing the configuration for the frame.
See also
args (Any)
kwargs (Any)
Examples
Example: LabeledLineExample ¶
from manim import * class LabeledLineExample(Scene): def construct(self): line = LabeledLine( label = '0.5', label_position = 0.8, label_config = { "font_size" : 20 }, start=LEFT+DOWN, end=RIGHT+UP) line.set_length(line.get_length() * 2) self.add(line)
class LabeledLineExample(Scene): def construct(self): line = LabeledLine( label = '0.5', label_position = 0.8, label_config = { "font_size" : 20 }, start=LEFT+DOWN, end=RIGHT+UP) line.set_length(line.get_length() * 2) self.add(line)Methods
Attributes
alwaysCall a method on a mobject every frame.
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.
- _original__init__(label, label_position=0.5, label_config=None, box_config=None, frame_config=None, *args, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.