NumberLine¶
Qualified name: algan.mobs.manim\_compat.NumberLine
- class NumberLine(x_range=None, length=None, unit_size=1, include_ticks=True, tick_size=0.1, numbers_with_elongated_ticks=None, longer_tick_multiple=2, exclude_origin_tick=False, rotation=0, stroke_width=2.0, include_tip=False, tip_width=0.35, tip_height=0.35, tip_shape=None, include_numbers=False, font_size=36, label_direction=array([ 0., -1., 0.]), label_constructor=<class 'algan.external_libraries.manim.mobject.text.tex_mobject.MathTex'>, scaling=<algan.external_libraries.manim.mobject.graphing.scale.LinearBase object>, line_to_number_buff=0.25, decimal_number_config=None, numbers_to_exclude=None, numbers_to_include=None, **kwargs)¶
Bases:
ManimCompatMobCreates a number line with tick marks.
- Parameters:
x_range (Sequence[float] | None) – The
[x_min, x_max, x_step]values to create the line.length (float | None) – The length of the number line.
unit_size (float) – The distance between each tick of the line. Overwritten by
length, if specified.include_ticks (bool) – Whether to include ticks on the number line.
tick_size (float) – The length of each tick mark.
numbers_with_elongated_ticks (Iterable[float] | None) – An iterable of specific values with elongated ticks.
longer_tick_multiple (int) – Influences how many times larger elongated ticks are than regular ticks (2 = 2x).
rotation (float) – The angle (in radians) at which the line is rotated.
stroke_width (float) – The thickness of the line.
include_tip (bool) – Whether to add a tip to the end of the line.
tip_width (float) – The width of the tip.
tip_height (float) – The height of the tip.
tip_shape (type[ArrowTip] | None) – The mobject class used to construct the tip, or
None(the default) for the default arrow tip. Passed classes have to inherit fromArrowTip.include_numbers (bool) – Whether to add numbers to the tick marks. The number of decimal places is determined by the step size, this default can be overridden by
decimal_number_config.scaling (_ScaleBase) – The way the
x_rangeis value is scaled, i.e.LogBasefor a logarithmic numberline. Defaults toLinearBase.font_size (float) – The size of the label mobjects. Defaults to 36.
label_direction (Point3DLike) – The specific position to which label mobjects are added on the line.
label_constructor (type[ManimTextLabel]) – Determines the mobject class that will be used to construct the labels of the number line.
line_to_number_buff (float) – The distance between the line and the label mobject.
decimal_number_config (dict | None) – Arguments that can be passed to
DecimalNumberto influence number mobjects.numbers_to_exclude (Iterable[float] | None) – An explicit iterable of numbers to not be added to the number line.
numbers_to_include (Iterable[float] | None) – An explicit iterable of numbers to add to the number line
kwargs (Any) – Additional arguments to be passed to
Line.exclude_origin_tick (bool)
Note
Number ranges that include both negative and positive values will be generated from the 0 point, and may not include a tick at the min / max values as the tick locations are dependent on the step size.
Methods
Attributes
animation_managerThis mob's scene-owned animation manager.
basisThe Mob's orientation and scale, as a flattened 3x3 matrix of shape
(*, 9).casts_shadowsWhether this Mob's geometry blocks light on its way from a light source to another surface -- whether it casts a shadow.
childrenThe Mobs attached below this one, in attachment order.
closed_shellWhether this Mob's triangles form a CLOSED shell -- every camera ray that enters the geometry crosses a second time on its way out.
draws_descendantsWhether
get_render_primitivesreturns geometry belonging to this Mob's DESCENDANTS as well as its own.forwardGet the direction the Mob is facing.
lifespanThis mob's [spawn, despawn) interval on its Scene timeline (a
Lifespan).locationThe Mob's position in world space, shape
(*, 3).normalized_basisThe Mob's orientation with scale divided out, shape
(*, 9).parentsThe Mobs this one is attached to, in attachment order.
receives_shadowsWhether this Mob's surfaces are darkened by shadows cast onto them.
rightGet the Mob's own rightward direction.
scale_coefficientThe Mob's scale along its own right, up and forward axes, shape
(*, 3).stroke_colorThe color of the circuit's border stroke.
two_sidedWhether this Mob's geometry should be lit from whichever side the ray arrives on.
upGet the Mob's own upward direction.
xThe Mob's x coordinate in world units, shape
(*, 1).xyThe Mob's x and y coordinates in world units, shape
(*, 2).yThe Mob's y coordinate in world units, shape
(*, 1).zThe Mob's z coordinate in world units, shape
(*, 1).z_indexWhich of two exactly coplanar circuits draws in front (higher wins).