data_to_pixel — ANNOTATE plot op

• Data kinds: axes × signal × signal → pairs

• Call: import fullseye as fs; fs.ledger.data_to_pixel(axes, x, y) (to call the implementation directly, import annotate; annotate.data_to_pixel(axes, x, y); from the registry, opsannotate.get("data_to_pixel"))

• Return value through the ledger: fullseye.ledger.data_to_pixel(...) returns only the declared out type pairs (the underlying function also returns auxiliary values). When you need what was dropped, use fullseye.ledger.data_to_pixel.raw(...) or call annotate.data_to_pixel directly.

Usage

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

Does not clip -- when lo > hi (inverted axis), np.clip(v, lo, hi) silently returns hi, producing "a plausible lying figure" with every point stuck to the edge (the generator in this repo was actually fooled by this once). Rejecting out-of-range values is the job of clip=True in plot_series, where it is an exception.

Returns

(ndarray, ndarray)

px, py (float, not rounded -- rounding is the drawing side's job).

Raises

ValueError

when a value at or below 0 is passed on a log axis (a figure that draws -inf as "the edge" is a lie).

when x and y differ in length (see below).

Notes

Rejecting a length mismatch was added on 2026-09-02. Right after the chain fuzzer became able to execute this op, the miner crashed with a raw ValueError from np.stack on a path that passed 2 signals of different length, which exposed it. Until then, even with 7 points in x and 3 points in y it raised no exception and returned the 2 arrays of different length as they were.

The danger is not crashing but not crashing -- zip the 2 returned arrays and only 3 points get drawn, at the positions of the first 3 x values. Neither that points vanished nor that x was shifted can be seen from the figure. The sibling plot_series rejected the same situation with "x and y must have the same length", so within the same family the discipline was split (it is the kind of bug that recurs if only one side is fixed, so the wording has been aligned too).

Detailed usage guide

• figure_annotation family guide

Background guides (the physics and conventions behind this op)

• dataset_conventions — Training-dataset conventions — COCO / YOLO / VOC and pitfalls in visual inspection

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_gallery — py -3.11 examples/annotate_gallery.py

• poc_beam_modal_video — py -3.11 examples/poc_beam_modal_video.py

• poc_camera_calibration — py -3.11 examples/poc_camera_calibration.py

• poc_crack_width_timeseries — py -3.11 examples/poc_crack_width_timeseries.py

• poc_motion_magnification — py -3.11 examples/poc_motion_magnification.py

• poc_strain_history — py -3.11 examples/poc_strain_history.py

• poc_structure_4d_deterioration — py -3.11 examples/poc_structure_4d_deterioration.py

• poc_superresolution_limits — py -3.11 examples/poc_superresolution_limits.py

• poc_traffic_counting — py -3.11 examples/poc_traffic_counting.py

• poc_wound_area_tracking — py -3.11 examples/poc_wound_area_tracking.py

• poc_xyt_event_surface — py -3.11 examples/poc_xyt_event_surface.py

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

label_points · annotate_invert_path · 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.