Place coordinates in the plot legend
1 view (last 30 days)
Show older comments
Miguel Albuquerque on 21 Jul 2022
Commented: Star Strider on 21 Jul 2022
Hey guys, is there a way of putting those red letters in the plot, at the front of "target" in the legend?
Its just replacing x and y in text but I dont know what coordinates to put, this is the code;
textString2 = sprintf('(%2.f, %2.f)', x, y);
title('Range over aeroplane movement');
legend('Azimuth Compression','Range Migration Correction','Target');
Edited: Star Strider on 21 Jul 2022
xv = 0:10:400;
ym = rand(2,size(xv,2))*3500;
x = 230;
y = 95;
plot(x, y, '^r')
legend('Azimuth Compression','Range Migration Correction',sprintf('(%2.0f,%2.0f) Target',x,y))
EDIT — (21 Jul 2022 at 14:48)
Minor format changes to the plot.
More Answers (0)
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!