Hi there,
I have a series images (.png) outputed from a matlab plotting script based on different sets of parameters.
I need to place all images on a cartesian plot, where X and Y represent the ratios of parameters.
My question is, what function in matlab that I can use to place those images in (x,y) coordinate, such as: plot (x,y, "image1.png")?
Thanks

 채택된 답변

Walter Roberson
Walter Roberson 2021년 3월 12일

0 개 추천

imread() into an array. image() the array.
image(Axeshandle, X, Y, ImageArray
X and Y are each coordinate vectors giving the left and right (X) and lower and upper (Y) data coordinates to use. The values should describe where to put the centers of the pixels.

댓글 수: 4

Sri Adiyanti
Sri Adiyanti 2021년 3월 13일
Thanks Walter, I have used imread() and image() but that only works for 1 image, as "hold on" function doesnt seem work when using image().
Here is attached, an illustration of the output i wish to get, please advise.
"hold on" works fine using image()
img1 = imread('cameraman.tif');
img1 = img1(:,:,[1 1 1]); %make color
img2 = imread('flamingos.jpg');
image(img2);
hold on
RLim = size(img2,2)-75;
TLim = size(img2,1)-75;
for K = 1 : 10
x = randi(RLim); y = randi(TLim);
image([x x+75], [y y+75], img1);
end
Sri Adiyanti
Sri Adiyanti 2021년 3월 13일
Thanks again Walter, I see you are using the same XY coordinates for all images.
In my case, the main XY plate for placing all images is in a different scale (xlim=[-24 24],ylim = [-20 20]) from the xy coordinates of the images (xlim = [0 700], ylim = [0 700]).
I have done the scaling but still only 1 image plotted.
Could you pls see the attached if you could advise what i have missed?
Sri Adiyanti
Sri Adiyanti 2021년 3월 14일
Thanks Walter, i managed to fix it..it works!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

릴리스

R2019a

태그

질문:

2021년 3월 12일

댓글:

2021년 3월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by