How to add an image(.fig) in figure?

조회 수: 3 (최근 30일)
alagu mathi
alagu mathi 2015년 2월 25일
댓글: Image Analyst 2015년 2월 25일
Hi,
I have the .fig image of west of india. I have to display that image inside the errorBar plot. I tried the following code I could not get the output.
Can any one help me to clear this?
load trees
[x1,map1]= imread('C:\Users\divecha21\Desktop\errorBar\west_india_map_1.tif')
subplot(1,2,1), subimage(x1,map1)
Thank you.

답변 (1개)

Image Analyst
Image Analyst 2015년 2월 25일
It looks like you have a TIF image, not a .fig file. Is that true? If so, is it a gray scale image, an RGB image, or an indexed image with a colormap stored along with it?
if map1 is empty, do this:
imshow(x1);
title('west_india_map_1.tif', 'FontSize', 25);
If map1 is not empty, do this:
imshow(x1);
colormap(map1);
colorbar;
title('Indexed Image', 'FontSize', 25);
  댓글 수: 1
Image Analyst
Image Analyst 2015년 2월 25일
Just noticed that you tagged it as matlab 2012 and imshow was only in the Image Processing Toolbox up until R2014b when it was added to base MATLAB. If you don't have the Image Processing Toolbox, use image() instead of imshow().

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

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by