GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - StackOverflowMATLABchat/coordinate2normalized: Normalize XY coordinates to MATLAB figure window containing axis

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
README.md
README.md
 
 
coord2norm.m
coord2norm.m
 
 
norm2coord.m
norm2coord.m
 
 

Repository files navigation

MATLAB FEX Minimum Version

coordinate2normalized

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);

coord2norm

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.

Example:

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

normx = [0.5, 0.55];
normy = [0.5, 0.55];
annotation('arrow', normx, normy);

hold on;
[coordx, coordy] = norm2coord(myaxes, normx, normy);
plot(coordx, coordy, 'or')

norm2coord

About

Normalize XY coordinates to MATLAB figure window containing axis

Resources

Readme
Activity
Custom properties

Stars

2 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.