How to add an image(.fig) in figure?
2 次查看(过去 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.
0 个评论
回答(1 个)
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
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().
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!