How to plot contourf using following information?
조회 수: 1(최근 30일)
표시 이전 댓글
댓글: UTKARSH VERMA 2021년 1월 7일
I am having data as follows:
I am using contourf(lon,lat,pr(:,:,:)) or contourf(lon,lat,pr(:,:,:)') but there is error of dimension
댓글 수: 0
KSSV 2021년 1월 7일
pr is a 3D matrix, you cannot use contourf on a 3D matrix. You need to draw layer by layer.
[m,n,p] = size(pr) ;
for i = 1:p
contourf(lon,lat,pr(:,:,i)) ; % if throws error, trispose pr
Also have a look on slice.
Bjorn Gustavsson 2021년 1월 7일
You would have to make one contour-plot for each time-step:
i_time = 1;
If I understood the dimensions correctly. So to get all you'll have to "animate" in some fashion. What gives the best illustration of what's going on depends on what's going on (a tautology, I know) so you have to be prepared to try different ideas to see what works best. I can for example imagine something like this working:
for i_time = 1:(size(pr,3)-3)
Find more on Purple in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!