Plotting contour line and filling contours for coastline Island data?

8 ビュー (過去 30 日間)
Natasha
Natasha 2014 年 11 月 21 日
コメント済み: Natasha 2014 年 11 月 22 日
My aim is to plot contour lines and fill these contour lines in using the function contourf. In order to show the area of the Island which would theoretically be safe to live on/ would be above sea level if the sea level were to rise.
I have tried numerous ways to attempt the above task but with great difficulty and have not succeeded. At present I have been able to plot a gray shaded relief map of the Island but cannot seem to get the coastline data not filled contours onto the map.
Assistance would be greatly appreciated.
The coastline data, and a picture of the ideal similar map that I want matlab to produce are also attached.
The attached map example if for temperature wheres as my plot will be for topographic elevation in relation to sea level rise for a different Island. Thanks

採用された回答

Chad Greene
Chad Greene 2014 年 11 月 21 日
編集済み: Chad Greene 2014 年 11 月 21 日
Use Kelly Kearney's contourfcmap.
I did not open the hgt file you posted because I'm unfamiliar with that format.
Below I make the ocean blue, 0 to 5 meters elevation is bright red, and everything above 5 m is forest green. Below I use rgb for the color values, but you could get those values any way you wish.
[lat,lon,z] = peaks;
z = 20*abs(z)-50;
SLR = 5; % meters sea level rise
mycolors = rgb('ocean blue','bright red','forest green');
contourfcmap(lon,lat,z,[min(z(:)) 0 SLR max(z(:))],mycolors)
  1 件のコメント
Natasha
Natasha 2014 年 11 月 22 日
Thank you for taking the time to reply to my query and provide a detailed plot.
I'm slightly confused as to how you formed the expression for the z value and also I have to show the area between 200-500metres that will not flood on the island in a different colour as well as an elevation/colorbar. Would you possibly know of how I would attempt this?
Thanks again Chad

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOceanography and Hydrology についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by