data_to_pixel — ANNOTATE plot op

Data kinds: axes × signal × signalpairs

Call: import annotate; annotate.data_to_pixel(axes, x, y) (or opsannotate.get("data_to_pixel"))

Usage

Map data points to pixel `(x, y) through an :func:axes_transform` mapping.

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

クリップしない ―― `np.clip(v, lo, hi)lo > hi`(反転軸)の

とき黙って `hi` を返し、全点が端に貼り付いた「もっともらしい嘘の図」に

なる(この repo の生成器で実際に一度騙されている)。範囲外を弾くのは

:func:plot_series の `clip=True` の仕事で、そこでは例外にする。

Returns

-------

(ndarray, ndarray)

`px, py`(float、丸めない ―― 丸めは描画側の仕事)。

Raises

------

ValueError

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

`xy` の長さが違うとき(下記)。

Notes

-----

長さの不一致を拒否するのは 2026-09-02 に足した。連鎖ファザーがこの op を

実行できるようになった直後、長さの違う 2 本の signal を渡す経路で採掘器が

`np.stack の生の ValueError で落ちて発覚した。それまでは x` 7 点・

`y` 3 点でも例外を出さず、長さの違う 2 本をそのまま返していた

危ないのは落ちることではなく、落ちないこと ―― 返った 2 本を `zip` すると

3 点だけが、x の先頭 3 つの位置に描かれる。点が消えたことも、x が

ずれたことも図からは分からない。兄弟の :func:plot_series は同じ状況を

`"x and y must have the same length"` で拒否していたので、**同じ族の中で

規律が割れていた**(片方だけ直しても再発する型なので、文言も揃えてある)。

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 pairs as input)

label_points · filled_polygon

Same category (plot)

axes_transform · 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.