Why the color of my map doesn't change when I change the scale?

조회 수: 4 (최근 30일)
Alessandra Iacobone
Alessandra Iacobone 2020년 12월 30일
편집: Alessandra Iacobone 2021년 1월 3일
Hi, I have a problem. I would like that the color of my map changes when I change the scale limits. I have tried to do this with caxis, this change the colorbar numbers but not the color on my map. Can you help me?
This is my code :
cmap = colormap(parula)
densityColors= makesymbolspec('Polygon', {'ADR',[min(t2.ADR) max(t2.ADR)], 'FaceColor',cmap});
usamap('conus')
geoshow(S2,'DisplayType','polygon','SymbolSpec',densityColors);
h = colorbar;
set(h, 'ylim', [9.0000 22.0000])
framem off; gridm off; mlabel off; plabel off;
caxis ([9.0000 22.0000])
(S2 is a structure for USA state to plot it with my data)
  댓글 수: 13
Mathieu NOE
Mathieu NOE 2021년 1월 2일
Ok , I could finally load Area and ADR but as I don't have the Mapping Toolbox I got stuck at line with shaperead
have you tried to comment the line : set(h, 'ylim', [8.7000 13.2000])
and how are now looking the maps ?
Alessandra Iacobone
Alessandra Iacobone 2021년 1월 3일
편집: Alessandra Iacobone 2021년 1월 3일
Yes, I solved the problem. I have to change max and min with the values that I want and do the same with caxis and set (h, 'ylim', [8.7000 13.2000]).
densityColors = fa simbolipec ('Polygon', {'ADR', [min (t2.ADR) max (t2.ADR)], 'FaceColor', cmap});

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by