LogBase

Qualified name: manim.utils.scale.LogBase

class LogBase(base=10, custom_labels=True)[source]

Bases: manim.utils.scale._ScaleBase

Scale for logarithmic graphs/functions.

Parameters
  • base (float) – The base of the log, by default 10.

  • custom_labels (bool, optional) – For use with Axes: Whetherer or not to include LaTeX axis labels, by default True.

Examples

func = ParametricFunction(lambda x: x, scaling=LogBase(base=2))

Methods

function

Scales the value to fit it to a logarithmic scale.``self.function(5)==10**5``

get_custom_labels

Produces custom Integer labels in the form of 10^2.

inverse_function

Inverse of function.

function(value)[source]

Scales the value to fit it to a logarithmic scale.``self.function(5)==10**5``

Parameters

value (float) –

Return type

float

get_custom_labels(val_range, unit_decimal_places=0, **base_config)[source]

Produces custom Integer labels in the form of 10^2.

Parameters
  • val_range (Iterable[float]) – The iterable of values used to create the labels. Determines the exponent.

  • units_decimal_places – The number of decimal places to include in the exponent

  • base_config (Dict[str, Any]) – Additional arguments to be passed to Integer.

  • unit_decimal_places (int) –

Return type

List[Mobject]

inverse_function(value)[source]

Inverse of function. The value must be greater than 0

Parameters

value (float) –

Return type

float