我有一个轮廓图,我想在上面放置一个点。contourfm 图本身可以正常工作,没有错误。但是当我尝试在特定点放置一个点时,它会覆盖轮廓图,只是在没有 eqdconic 图形且纬度和经度线挤压在一起的白色背景上放置一个点。我正在使用hold on,我尝试先绘制数据并先绘制点,但两者都产生相同的结果。谁能告诉我我做错了什么?我想也许我不应该使用“情节”作为命令。
** 代码已被修改以反映答案。使用 plotm 代替 plot。点的 x 和 y 值被切换以反映 MATLAB 的 lat、lon 顺序(而不是 lon、lat。)
% Eqdconic script
% Define figure and axes
fg1 = figure(1);
% set(fg1, 'paperposition', [0 0 8.5 8.5]);
axesm('MapProjection','eqdconic', 'MapParallels', [], 'MapLatLimit',[-80 -60],'MapLonLimit',[190 250]) % 60-70S and 120-160W
framem on; gridm on; mlabel on; plabel on; hold all;
% Old code that was incorrect:
% xValue = find(x(:,1) == 224); % Longitude closest to 136 03.56W
% yValue = find(y(1,:) == -66.75); % Latitude closest to 66 39.67S
% plot(xValue,yValue,'b.','MarkerSize',20); % Plot a black dot
% Plot dot
plotm(-66.75,224,'k.','MarkerSize',20);
hold on
% Plot data
frame = dataPoint(:,:,k);
contourfm(y,x,frame, 'LineStyle', 'none');
% Colorbar
caxis([0 100]);
h = colorbar;
ylabel(h,'Percent');
% Title: Days 1:1258 inclusive. 20100101 to 20130611
date = datenum(2009, 12, 31) + k; % Convert t into serial numbers
str = datestr(date, 'mmm yyyy');
title(str);