Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Create an image using and displaying only specific types.

1 回表示 (過去 30 日間)
Danai Varvatsouli
Danai Varvatsouli 2020 年 7 月 2 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello, I have an excel file that includes specific land types of Greece, and a tif image of Greece I want to Zoom a specific region in Greece and from all the land types that exist in the excel file, I would like to display only specific ones 10-30, and include them as a legend at the side of the figure.
So my code so far is:
[I,map1],imread('greece.tif');
Greece_Image=ind2rgb(I,map1);
Types=readtable('clc_legend.xls');
land_red=double(table2array(Types(:,10)));
land_green=double(table2array(Types(:,11)));
land_blue=double(table2array(Types(:,12)));
Region=Greece_Image(ceil(0.87*size(Greece_Image,1)):end,ceil(0,5**size(Greece_Image,1)):ceil(0.9*size(Greece_Image,1)),:);
figure;
imshow(Region);
title('Zoom');
xlabel('longtitude');
ylabel('latitude');
set(gca,'XTickLabel',[],'YTickLabel',[])
set(gcf,'ColorMap',a2);
p=colorbar('Location','WestOutside','Ytick',12:1:32,'YTickLabel',Region.textdata(12:1:34,4),'fontsize',5);
I tried this but on the figure it displays all the land types of all Greece, and the names of the lands are not visible.
Does anyone know how to fix it so it displays only the land types 10-30 with their names visible?Also If possible every bar to have the color of the land type that it represent.

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by