axes_transform — ANNOTATE plot op

Data kinds: noneaxes (an op determined by its arguments alone — it takes no image or data input)

Call: import annotate; annotate.axes_transform(rect, xlim, ylim, invert_y=True, xscale='linear', yscale='linear') (or opsannotate.get("axes_transform"))

Usage

Build the (closed-form) mapping from data coordinates to pixel coordinates.

> The detailed description below is the original text — the summary and the headings are translated.

`row は下向き という画像の事実と、y は上向き` というグラフの慣習の

ずれを、この 1 か所だけで吸収する。図のコードはこの辞書を持ち回る。

px = x0 + (x - xmin)/(xmax - xmin) * (w - 1)

py = y0 + (h - 1) - (y - ymin)/(ymax - ymin) * (h - 1) # invert_y

Parameters

----------

rect : (x, y, w, h)

描画域(左上基準、画素)。

xlim, ylim : (lo, hi)

データ範囲。lo == hi は傾きが無限大になるので ValueError。

lo > hi(反転軸)も許す ―― 深度やランクを上下逆に描くため。

invert_y : bool

True(既定)なら `ylim[0]` が下端に来る = 普通のグラフ。

False なら画像そのままの向き(上端が `ylim[0]`)。

xscale, yscale : {'linear','log'}

`'log'` は常用対数。範囲に 0 以下が入れば ValueError

(log 軸に 0 を渡して -inf を「端」として描く図は嘘になる)。

Returns

-------

dict

`{"rect", "xlim", "ylim", "invert_y", "xscale", "yscale"}`。

Raises

------

ValueError

矩形が不正、範囲が非有限か幅ゼロ、w か h が 2 未満、

未知の scale、log 軸で範囲に 0 以下。

Detailed usage guide

figure_annotation family guide

Background guides (the physics and conventions behind this op)

dataset_conventions — 学習データセット規約の知識 — COCO / YOLO / VOC と外観検査での落とし穴

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

annotate_gallerypy -3.11 examples/annotate_gallery.py

Ops the type connects to (they accept axes as input)

data_to_pixel · axes_frame · grid_lines · ticks · plot_series

Same category (plot)

data_to_pixel · nice_ticks · axes_frame · grid_lines · ticks · plot_series


*Provenance: annotate.py — ANNOTATE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.