如何在Matlab中制作动画地理地图?

如何在Matlab中制作动画地理地图?,matlab,animation,dictionary,Matlab,Animation,Dictionary,我们正试图绘制一段时间内湖泊的大小。我们已经让它大部分工作,问题是,我们正在清理和重新绘制湖泊每年,但它看起来很奇怪,因为湖泊是每年一次绘制一个。如果我们能够清除屏幕,绘制所有内容,然后更新显示,而不是每年都看着湖泊重新绘制,那就太好了。有什么想法吗?这是我们的密码 clear all; close all; clc; %%Plot the map of Wisconsin wi = shaperead('usastatehi', 'UseGeoCoords', true,'Selector'

我们正试图绘制一段时间内湖泊的大小。我们已经让它大部分工作,问题是,我们正在清理和重新绘制湖泊每年,但它看起来很奇怪,因为湖泊是每年一次绘制一个。如果我们能够清除屏幕,绘制所有内容,然后更新显示,而不是每年都看着湖泊重新绘制,那就太好了。有什么想法吗?这是我们的密码

clear all; close all; clc;

%%Plot the map of Wisconsin
wi = shaperead('usastatehi', 'UseGeoCoords', true,'Selector',{@(name)...
    strcmpi(name,'Wisconsin'), 'Name'});
axesm('mercator','MapLatLimit',[42.4569,47.0448],'MapLonLimit',[-92.9644,...
    -86.6662])

geoshow(wi,'FaceColor','white')

%%Plot the lake area changes through the years
load lakearea.mat
load lakeloc.mat

lat_lake = lakeloc(1,:);
lon_lake = lakeloc(2,:);
years =29;
numlake =12;
for j = 1:1:years
    clma
    geoshow(wi,'FaceColor','white')
    lake_area = lakearea(j,2:13);
    for i=1:1:numlake
        if lake_area(i) ~= 0
            scatterm(lat_lake(i),lon_lake(i),lake_area(i)/(10^4),'filled')
        end
    end
end

以下解决方案可能有效:隐藏图形:
设置(gcf,'Visible','off')
。在不可见的图形上绘制图像。使用
getimage
获取图像数据。恢复可见性,并逐帧显示图像。以下解决方案可能有效:隐藏图形:
set(gcf,'Visible','off')
。在不可见的图形上绘制图像。使用
getimage
获取图像数据。恢复可见性,并逐帧显示图像。