axes_transform — ANNOTATE plot op

数据种类:axes(仅由参数决定的算子 —— 不接受图像或数据输入)

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

用法

构建数据坐标 → 像素坐标的(闭式)映射。

> 以下的详细说明为原文 —— 摘要与标题已翻译。

`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 以下。

详细使用指南

figure_annotation 族使用指南

背景知识指南(该算子背后的物理与约定)

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

参考(示例数据・文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者・年份)与用途见上面的族使用指南

可运行的示例(实际调用该算子并已验证的样例)

annotate_gallerypy -3.11 examples/annotate_gallery.py

类型可衔接的下一个算子(可接受 axes 作为输入)

data_to_pixel · axes_frame · grid_lines · ticks · plot_series

同类别(plot)

data_to_pixel · nice_ticks · axes_frame · grid_lines · ticks · plot_series


*Provenance: annotate.py — ANNOTATE 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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