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: ManimCompatMob

Creates 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 from ArrowTip.

  • 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_range is value is scaled, i.e. LogBase for a logarithmic numberline. Defaults to LinearBase.

  • 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 DecimalNumber to 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_manager

This mob's scene-owned animation manager.

basis

The Mob's orientation and scale, as a flattened 3x3 matrix of shape (*, 9).

casts_shadows

Whether this Mob's geometry blocks light on its way from a light source to another surface -- whether it casts a shadow.

children

The Mobs attached below this one, in attachment order.

closed_shell

Whether this Mob's triangles form a CLOSED shell -- every camera ray that enters the geometry crosses a second time on its way out.

draws_descendants

Whether get_render_primitives returns geometry belonging to this Mob's DESCENDANTS as well as its own.

forward

Get the direction the Mob is facing.

lifespan

This mob's [spawn, despawn) interval on its Scene timeline (a Lifespan).

location

The Mob's position in world space, shape (*, 3).

normalized_basis

The Mob's orientation with scale divided out, shape (*, 9).

parents

The Mobs this one is attached to, in attachment order.

receives_shadows

Whether this Mob's surfaces are darkened by shadows cast onto them.

right

Get the Mob's own rightward direction.

scale_coefficient

The Mob's scale along its own right, up and forward axes, shape (*, 3).

stroke_color

The color of the circuit's border stroke.

two_sided

Whether this Mob's geometry should be lit from whichever side the ray arrives on.

up

Get the Mob's own upward direction.

x

The Mob's x coordinate in world units, shape (*, 1).

xy

The Mob's x and y coordinates in world units, shape (*, 2).

y

The Mob's y coordinate in world units, shape (*, 1).

z

The Mob's z coordinate in world units, shape (*, 1).

z_index

Which of two exactly coplanar circuits draws in front (higher wins).