You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Functions xput, yput, and zput return the respective x, y, or z coordinate of a given fraction of the full x, y, or z range of a plot. These are useful if you have several plots with different data ranges, but you want text or a marker to appear in the same position relative to the frame of each plot. Input argument is simply the fractional linear dimension from 0 to 1.
EXAMPLE:
x = -40:120;
y = x + 10*sin(x);
plot(x,y); hold on
plot(xput(.2),yput(.4),'rp','markersize',15)
text(xput(.1),yput(.9),'this is an example','fontsize',14)
text(xput(.6),yput(.25),'another example!','fontsize',16)
box off
Cite As
Chad Greene (2026). Fractional position on plots (https://www.mathworks.com/matlabcentral/fileexchange/38110-fractional-position-on-plots), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0.0 (8.17 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
