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

5 次查看(过去 30 天)
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 中查找有关 Images 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by