フィルターのクリア

pcolor LOOP of current speed and a map of the area.

2 ビュー (過去 30 日間)
Claudio Iturra
Claudio Iturra 2022 年 11 月 1 日
コメント済み: Claudio Iturra 2022 年 11 月 2 日
Hello everyone,
Im trying to make a loop of a specific variable using pcolor, but I don't want to add the map area in every loop stage. There's is any way to permanently keep the map area and only change the pcolor variable, thanks for your time.
for i = 1 :8*4;
pcolor(lon,lat,u(:,:,i));
% hold on, fillseg(map(:,1),map(:,2)),hold off; %map of the coastal area
colormap c2h,caxis([-0.5 0.5]);
title(num2str(gtime(i,4)));
pause(.1);
end

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2022 年 11 月 1 日
If you take care of the handle you get from pcolor you should be able to do something like this:
H = pcolor(...)
% Initial plottery
phMap = fillseg(map(:,1),map(:,2)); %map of the coastal area
hold on
colormap(c2h)
%
for i = 1 :8*4;
pch = pcolor(lon,lat,u(:,:,i));
caxis([-0.5 0.5]);
title(num2str(gtime(i,4)));
pause(.1);
delete(pch)
end
If you want the map on top of the pcolor plot, one easy QD-fix is to replace pcolor with something like:
pch = surf(lon,lat,-1*ones(size(u(:,:,i))),u(:,:,i));view(0,90)
HTH
  1 件のコメント
Claudio Iturra
Claudio Iturra 2022 年 11 月 2 日
Thanks Bjorn, works great!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by