Add data tips to figure using code

3 views (last 30 days)
I open multiple images to separate figures and drop couple of data tips manually. I want to start to automate this process but keep this same way of working so I would like have these pre added data tips when figure opens and i could move they if they are in wrong position. I have the pixel locations where i want to drop those data tips. I have googled 1000 links but havent seen any example so is this even possible?

Accepted Answer

Kevin Holly
Kevin Holly on 22 Aug 2022
Edited: Kevin Holly on 22 Aug 2022
img = rand(800,1000);
h = imagesc(img);
d = datatip(h);
d.Location = "northwest";
d2 = datatip(h);
d2.Location = "northeast";
d3 = datatip(h);
d3.Location = "southwest";

More Answers (1)

Mika Ihatsu
Mika Ihatsu on 22 Aug 2022
Thank you so much, exactly what i needed!


Find more on Develop uifigure-Based Apps 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!

Translated by