LogBase

限定名称: manim.mobject.graphing.scale.LogBase

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

基础类:_ScaleBase

对数图/函数的比例尺。

Parameters:
  • base (float) – 对数的底数,默认为10。

  • custom_labels (bool) – 用于 Axes: 是否包含 LaTeX 轴标签,默认为 True。

示例

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

方法

function

将值缩放以适应对数刻度。``self.function(5)==10**5``

get_custom_labels

生成自定义的Integer标签,形式为10^2

inverse_function

function的逆函数。

function(value)[来源]

将值缩放到对数尺度。``self.function(5)==10**5``

Parameters:

(浮点数)

Return type:

浮点数

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

生成自定义的Integer标签,形式为10^2

Parameters:
  • val_range (Iterable[float]) – 用于创建标签的值的可迭代对象。确定指数。

  • unit_decimal_places (int) – 指数中包含的小数位数

  • base_config (dict[str, Any]) – 传递给Integer的额外参数。

Return type:

列表[Mobject]

inverse_function(value)[来源]

function的倒数。该值必须大于0

Parameters:

(浮点数)

Return type:

浮点数