필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Generating the plots on the same figure using image command.

조회 수: 1 (최근 30일)
Phenomenal One
Phenomenal One 2019년 3월 23일
마감: MATLAB Answer Bot 2021년 8월 20일
I am generating the plots using image command in matlab that is image(x,y,Z). Unlike plot command which we can do a "hold on" to generate the plots on the same figure, it seems we cannot do with the image command.
I am running a loop in which every loop generates a figure from the image command, I want to generate the plots on the same figure(using the image command), any help?

답변 (2개)

Image Analyst
Image Analyst 2019년 3월 23일
Use subplot if you want separate plots in an array
for k = 1 : 20
subplot(4, 5, k);
imshow(..............
end
  댓글 수: 9
Image Analyst
Image Analyst 2019년 3월 24일
How are you creating the bitmapped RGB images, that you then go on to display with image() or imshow()?
Phenomenal One
Phenomenal One 2019년 3월 25일
Sorry, but that was just an example of how three different plots are there in single figure. I want to do the same witht the image command

Walter Roberson
Walter Roberson 2019년 3월 25일
image() is fine to draw additional images in an axes when "hold on" is in effect.
Remember, though, that by default if you do not pass image() x, y data, or XData YData parameters, then image() is going to assume [1, number of columns] and [1, number of rows] as the XData and YData -- each pixel being one data unit. If your second image is the same size or later than the original image, then it is going to cover the original up completely -- unless, that is, that the newer image happens to have AlphaData set so that it is transparent in places.
im = imread('cameraman.tif');
image(im);
colormap(gray)
hold on
image([64 128], [64 128], img);
hold off
and observe that there is a smaller image overlayed on top of the first image. (Smaller because x y coordinates specified told it where the corners were to draw the image at.)
Remember, images are opaque by default, so you cannot see anything underneath an image unless you tell MATLAB to make the image transparent.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by