Fractional position on plots
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 (2024). Fractional position on plots (https://www.mathworks.com/matlabcentral/fileexchange/38110-fractional-position-on-plots), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
xput/
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |