coord2norm

バージョン 1.0.0.0 (5.04 KB) 作成者: sco1
Normalize XY coordinates to MATLAB figure window containing axis
ダウンロード: 855
更新 2021/11/9

COORD2NORM(axishandle, x, y) takes input XY coordinates, relative to the axes object axishandle, and normalizes them to the parent container of axishandle. This is useful for functions like annotation, where the input XY coordinates are normalized to the parent container of the plotting axes object and not to the data being plotted. axishandle must be a valid MATLAB axes object (HG2) or handle (HG1).
COORD2NORM returns discrete arrays xnorm and ynorm of the same size as the input XY coordinate arrays.
Example:

myaxes = axes();
x = -10:10;
y = x.^2;
plot(x, y);

[normx, normy] = coord2norm(myaxes, [x(1) x(2)], [y(1) y(2)]);
annotation('arrow', normx, normy);

Also included is the helper function NORM2COORD which performs the reverse operation, mapping coordinates normalized to the parent container of axishandle to the data space of axishandle.

This function builds on existing FEX submissions with the inclusion of logarithmic plot support (loglog, semilogx, semilogy).

引用

sco1 (2024). coord2norm (https://github.com/StackOverflowMATLABchat/coordinate2normalized), GitHub. 取得済み .

MATLAB リリースの互換性
作成: R2007a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
タグ タグを追加

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub の既定のブランチを使用するバージョンはダウンロードできません

バージョン 公開済み リリース ノート
1.0.0.0

Added attribution

この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。
この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。