I need to know how to create a contour plot that changes with time.

3 次查看(过去 30 天)
I have a 3 column vectors of Latitude, Longitude and Total Electron Content(TEC) having domensionality of 86400x1. I have created contour plot that gives the coordinate dependant distribution of the TEC. Using the following code
lat=IPP(:,1); %% IPP is the matrix whose 1st column is latitude
lon=IPP(:,2); %% IPP is the matrix whose 2nd column is longitude
tec=VTEC(:,1);
[xq,yq]=meshgrid(min(lat):.1:max(lat),min(lon):.1:max(lon));
[X,Y,Z]=griddata(lat,lon,tec,xq,yq);
%%Contour plot of VTEC
contourf(X,Y,Z,100,'linestyle','none');
xlabel('Latitude');
ylabel('Longitude');
Now I need to know how to push this plot into the fourth dimension by showing the time evoltuon of the contour plot. The data was recorded over a 24 hour interval with a frequency of 1 Hertz.

回答(1 个)

Simon Chan
Simon Chan 2022-3-16
Update the contour plot properties from the 2nd data.
Check this example:
clear; clc;
t = 1:10;
for k = 1:10
x = linspace(-2*pi,2*pi);
y = linspace(0,t(k)*pi);
[X,Y] = meshgrid(x,y);
Z = sin(X) + cos(Y);
if k == 1
[M,c] = contourf(X,Y,Z,10);
else
c.XData = X; % Update X
c.YData = Y; % Update Y
c.ZData = Z; % Update Z
end
pause(1);
end

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by