필터 지우기
필터 지우기

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