フィルターのクリア

How can I superimpose my contour plot to a map using usamap function?

2 ビュー (過去 30 日間)
Behrooz Daneshian
Behrooz Daneshian 2023 年 2 月 19 日
コメント済み: Walter Roberson 2023 年 2 月 19 日
Using the following code I could develope countour maps showing freezing depth across the Alaska states. How can I superimpose these contours to the Alaska map?. When I use usamap function and hold on together, contours will not be displayed on the Alaska map.
clear
close all
clc
load('POFDE.mat');
data = cell2mat(POFDE);
[lat,lon] = meshgrid(unique(data(:,1)),unique(data(:,2)));
for i = 1:(size(data, 2)-2)
figure
usamap("Alaska")
states = readgeotable("usastatehi.shp");
row = states.Name == "Alaska";
alaska = states(row,:);
geoshow(alaska,"FaceColor",[0.3 1.0, 0.675])
textm(alaska.LabelLat,alaska.LabelLon,alaska.Name, ...
"HorizontalAlignment","center")
hold on;
I = scatteredInterpolant(data(:,[1 2]), data(:,i+2));
contourm(lon,lat,min(1,max(0,I(lat,lon))),'ShowText','on')
colorbar
title(['The probability of frost depth exceedance of \Omega_{\delta} = ' num2str(i) ' feet'])
exportgraphics(gca, sprintf('FrostPlot_%d_feet.png', i))
hold off
end

採用された回答

Walter Roberson
Walter Roberson 2023 年 2 月 19 日
contourm needs lat then long
  2 件のコメント
Behrooz Daneshian
Behrooz Daneshian 2023 年 2 月 19 日
sorry that must be contourf
Walter Roberson
Walter Roberson 2023 年 2 月 19 日
You cannot use contourf with an axesm based axes. contourf is only suitable for cartesian axes.
You can possibly use contourm with the 'fill' option.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by