Filter löschen
Filter löschen

Open a jpg picture for each data point by clicking on the plot

1 Ansicht (letzte 30 Tage)
H R
H R am 21 Dez. 2018
Beantwortet: Walter Roberson am 21 Dez. 2018
Hi there.
I have a simple 2D data set (x,y). Each point (xi,yi,i) (i=0,..n) corresponds to a JPG picture. The JPG names are (0.jpg, 1.jpg,...).
I would like to be able to open the corresponding JPG image, when I click on the 2D plot (i.e. the closest data point to the place I am clicking). How can I do that?
Thank you.

Antworten (1)

Walter Roberson
Walter Roberson am 21 Dez. 2018
ginput() to get x and y coordinates . round or ceil to get integers and cross check that they are within range. use them to index into an array of image file numbers . sprintf to get a file name . read the corresponding file and display it in the appropriate place .
Just remember that x coordinates correspond to horizontal distance not to vertical distance .

Kategorien

Mehr zu Visual Exploration finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by