NumberLine.point_to_number ignores LogBase scaling, so get_graph_label misplaces labels on log axes
Description of bug / unexpected behavior
On an axis with LogBase scaling, NumberLine.number_to_point applies the
scaling but NumberLine.point_to_number does not. It takes the point's
proportion along the line, which is logarithmic, and interpolates linearly
between the end values of the axis, here 1 and 1000. So Axes.point_to_coords
is not the inverse of Axes.coords_to_point: ax.p2c(ax.c2p(100, 0.5))
returns [666.7, 0.5]. The function is the same on main
(manim/mobject/graphing/number_line.py).
Anything that maps a point back to a value inherits the error. For a graph
without underlying_function, such as the "line_graph" of
plot_line_graph, CoordinateSystem.input_to_graph_point binary-searches
point_to_coords, so get_graph_label(..., x_val=100, dot=True) places its
label and dot at x of about 2, where the linear interpolation reaches 100.
Expected behavior
ax.p2c(ax.c2p(100, 0.5)) returns [100, 0.5], and the label and dot sit on
the curve at x = 100.
How to reproduce the issue
Code for reproducing the problemimport numpy as np
from manim import Axes, LogBase, Scene
class LogScaleGraphLabel(Scene):
def construct(self):
ax = Axes(
x_range=[0, 3],
y_range=[0, 1],
tips=False,
axis_config={"include_numbers": True},
x_axis_config={"scaling": LogBase(custom_labels=True)},
)
grid = np.logspace(0, 3)
line = ax.plot_line_graph(grid, 0.99**grid, add_vertex_dots=False)
print(ax.p2c(ax.c2p(100, 0.5)))
self.add(
ax,
line,
ax.get_graph_label(line["line_graph"], "x=100", x_val=100, dot=True),
)Additional media files
Images/GIFsThe last frame, rendered with -s -ql, shows the dot labelled x=100 on the
curve between the ticks for 10^0 and 10^1, at x of about 2.
Logs
Terminal outputThe second line is the printed ax.p2c(ax.c2p(100, 0.5)).
Manim Community v0.21.0
[6.67e+02 5.00e-01]
[09/29/26 00:10:57] INFO scene_file_writer.py:1103
File ready at 'C:\Users\<user>\<project>\results\issues\media\images\log_scale_label\LogScaleGraphLabel_ManimCE_v0.21.0.png'
INFO Rendered LogScaleGraphLabel scene.py:290
Played 0 animationsSystem specifications
System Details- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Windows 11 Pro 10.0.26200
- RAM: 31.1 GB
- Python version (
python/py/python3 --version): 3.12.14 - Installed modules (provide output from
pip list):
Package Version Editable project location
--------------------------------------- ------------------------------- -------------------------------------
aiohappyeyeballs 2.7.1
aiohttp 3.14.3
aiosignal 1.4.0
annotated-types 0.8.0
anyio 4.14.2
argon2-cffi 25.1.0
argon2-cffi-bindings 25.1.0
argparse-dataclass 2.0.0
arrow 1.4.0
asttokens 3.0.2
async-lru 2.3.0
attrs 26.1.0
autograd 1.9.1
autograd-gamma 0.5.0
av 18.1.0
babel 2.18.0
beautifulsoup4 4.15.0
bibliography 0.1.dev17+gaaabc3772
bibtexparser 1.4.4
bleach 6.4.0
certifi 2026.7.22
cffi 2.1.1
charset-normalizer 3.5.1
click 8.5.0
cloup 4.0.0
colorama 0.4.6
comm 0.2.3
conda-inject 1.3.2
configargparse 1.7.7
connection-pool 0.0.3
contourpy 1.3.3
coverage 7.16.1
cycler 0.12.1
datasets 5.0.1
debugpy 1.8.21
decorator 5.3.1
defusedxml 0.7.1
deptry 0.25.1
dill 0.4.1
docutils 0.22.4
dpath 2.2.0
duckdb 1.5.5
executing 2.2.1
fastjsonschema 2.22.2
feedparser 6.0.14
feedparser-sgmllib 2.1.0
filelock 3.32.3
fonttools 4.63.0
formulaic 1.2.2
fqdn 1.5.1
frozenlist 1.8.0
fsspec 2026.6.0
gitdb 4.0.12
gitpython 3.1.62
glcontext 3.0.0
graphviz 0.21
greenlet 3.5.6
h11 0.16.0
habanero 2.3.0
hf-xet 1.6.0
httpcore 1.0.9
httpcore2 2.13.1
httpx 0.28.1
httpx2 2.13.1
huggingface-hub 1.32.0
humanfriendly 10.0
hypothesis 6.167.1
idna 3.18
immutables 0.21
iniconfig 2.3.0
interface-meta 2.0.1
ipykernel 7.3.0
ipython 9.16.1
ipython-pygments-lexers 1.1.1
ipywidgets 8.1.8
isoduration 20.11.0
isosurfaces 0.1.2
jaraco-classes 3.4.0
jaraco-context 6.1.2
jaraco-functools 4.6.0
jax 0.11.1
jaxlib 0.11.1
jedi 0.20.0
jinja2 3.1.6
joblib 1.5.3
json5 0.15.0
jsonpointer 3.1.1
jsonschema 4.26.0
jsonschema-specifications 2025.9.1
jupyter 1.1.1
jupyter-builder 1.2.2
jupyter-client 8.9.1
jupyter-console 6.6.3
jupyter-core 5.9.1
jupyter-events 0.12.1
jupyter-lsp 2.3.1
jupyter-server 2.20.0
jupyter-server-terminals 0.5.4
jupyterlab 4.6.3
jupyterlab-pygments 0.3.0
jupyterlab-server 2.28.0
jupyterlab-widgets 3.0.16
kagglehub 1.0.2
kagglesdk 0.1.37
keyring 25.7.0
kiwisolver 1.5.0
lark 1.3.1
lazy-loader 0.6
lifelines 0.30.0
manim 0.21.0
manimpango 0.6.1
mapbox-earcut 2.1.0
markdown-it-py 4.2.0
markupsafe 3.0.3
matplotlib 3.11.1
matplotlib-inline 0.2.2
mdurl 0.1.2
mistune 3.3.4
ml-dtypes 0.6.0
moderngl 5.12.0
moderngl-window 3.1.1
more-itertools 11.1.0
mpmath 1.3.0
multidict 6.9.1
multiprocess 0.70.19
narwhals 2.25.0
nbclient 0.11.0
nbconvert 7.17.1
nbformat 5.11.0
nest-asyncio2 1.7.2
networkx 3.6.1
notebook 7.6.2
notebook-shim 0.2.4
numpy 2.5.2
opt-einsum 3.4.0
packaging 25.0
pandas 3.0.5
pandocfilters 1.5.1
parso 0.8.7
patsy 1.0.3
pillow 12.3.0
platformdirs 4.11.3
pluggy 1.6.0
prometheus-client 0.26.0
prompt-toolkit 3.0.53
propcache 0.5.4
protobuf 7.36.2
psutil 7.2.2
pulp 3.3.2
pure-eval 0.2.3
pyalex 0.21
pyarrow 25.0.1
pycairo 1.29.1
pycparser 3.0
pydantic 2.13.5
pydantic-core 2.46.5
pydub 0.25.1
pyglet 2.1.16
pyglm 2.8.3
pygments 2.20.0
pylatexenc 2.11
pyparsing 3.3.2
pyreadline3 3.5.6
pytest 9.1.1
pytest-cov 7.1.0
python-dateutil 2.9.0.post0
python-json-logger 4.2.0
pywin32-ctypes 0.2.3
pywinpty 3.0.5
pyyaml 6.0.3
pyzmq 27.1.0
pyzotero 1.15.2
referencing 0.37.0
requests 2.34.2
requirements-parser 0.13.1
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rfc3987-syntax 1.1.0
rich 15.0.0
rpds-py 2026.6.3
scikit-learn 1.9.0
scipy 1.18.0
screeninfo 0.8.1
seaborn 0.13.2
send2trash 2.1.0
setuptools 84.0.0
six 1.17.0
skia-pathops 0.9.2
smart-open 7.7.1
smmap 5.0.3
snakemake 9.27.0
snakemake-executor-plugin-slurm 2.8.0
snakemake-executor-plugin-slurm-jobstep 0.6.1
snakemake-interface-common 1.23.0
snakemake-interface-executor-plugins 9.4.0
snakemake-interface-logger-plugins 2.1.0
snakemake-interface-report-plugins 1.3.0
snakemake-interface-scheduler-plugins 2.0.2
snakemake-interface-storage-plugins 4.4.1
sortedcontainers 2.4.0
soupsieve 2.9.2
sqlalchemy 2.0.54
sqlmodel 0.0.37
srt 3.5.3
stack-data 0.6.3
statsmodels 0.15.0
svgelements 1.9.6
sympy 1.14.0
tabulate 0.10.0
tenacity 9.1.4
terminado 0.18.1
threadpoolctl 3.6.0
throttler 1.2.3
tinycss2 1.5.1
tomli 2.4.1
torch 2.14.0
torchvision 0.29.0+cu130
torchviz 0.0.3
tornado 6.5.8
tqdm 4.70.0
traitlets 5.16.1
truststore 0.10.4
typing-extensions 4.16.0
typing-inspection 0.4.4
tzdata 2026.3
tzlocal 5.4.4
ucimlrepo 0.0.7
uri-template 1.3.0
urllib3 2.7.0
watchdog 6.0.0
wcwidth 0.8.2
webcolors 25.10.0
webencodings 0.6.1
websocket-client 1.9.0
whenever 0.10.5
widgetsnbextension 4.0.15
wiley-tdm 1.2.0
wrapt 2.4.1
xxhash 4.0.1
yarl 1.25.1
yte 1.9.4- LaTeX distribution (e.g. TeX Live 2020): TeX Live 2026
- Installed LaTeX packages:
scheme-full, 5187 packages intlmgr info --only-installed
Additional comments
A graph from plot() is unaffected, because input_to_graph_point then calls
graph.function(x), which goes through coords_to_point.
Source: ManimCommunity/manim