- Assume you have X,Y,Z data. X, Y are 2D and Z is a 3D matrix of a variable which eveolves with time.
- Fix a lon (x) or lat (y) .
- Along the fixed lon/lat you have lat/lon varying.
- Get the row index (if lon constant), column index (if lat constant).
- Extract the above index data from Z for all times. This will be a matrix H.
- Use pcolor with lat (if lon constant) or lon (if lat constant) along X-axes and time along Y-axes.
Hovmoller Diagram / Heat Map -- need help with creating plot?
10 次查看(过去 30 天)
显示 更早的评论
Hello MATLAB Community,
I am working with satellite data and want to produce a Hovmoller diagram (or heat map, as I like to think about it), with Latitude on my x-axis, Time on my y-axis, and a certain measurement (represented by 'AOD' in my code) represented by color. The satellite will keep returning to about the same Latitude over and over again. My Latitude values however are all unique, with minute differences between them. In the same way, my time values are also unique, with small differences on the order of seconds between them.
I have three vectors of the same size where a certain unique latitude is associated with a certain unique time which is associated with a certain measurement. I'd like to reshape my measurement vector into a matrix; here is my code thus far:
% The AOD matrix will be the size of x * y (Lat x Time), and NaN values will be
% present in accordance with the if statement below.
[ Latitude , time ] = meshgrid( Master_Latitude_screened_sorted , Master_Profile_Time_screened_sorted);
Master_AOD_screened_matrix = NaN(size( Latitude )) ;
AOD_grid = griddata(Master_Latitude_screened_sorted, Master_Profile_Time_screened_sorted, Master_AOD_screened_sorted, Latitude, time);
for i = 1:length(Master_Latitude_screened_sorted)
disp(i) % to know which iteration of the loop it is on.
% To kill and evaluate only a few of the values, ctrl - C!
for j = 1:length(Master_Profile_Time_screened_sorted)
for k = 1:length(Master_AOD_screened_sorted)
if Master_Latitude_screened_sorted(k) == Latitude(i,j) && Master_Profile_Time_screened_sorted(k) == time(i,j)
Master_AOD_screened_matrix(i,j) = Master_AOD_screened_sorted(k);
end
end
end
end
Should producing a heat map from these vectors be possible? I understand that I likely have to turn my measurement vector into a matrix... is that possible considering I have all unique values of Latitude and Time? Do I need to round out my Latitude and Time values perhaps to the integer/daily scale so that the matrix can be formed?
Any help would be much appreciated!
Thanks.
0 个评论
回答(2 个)
KSSV
2019-5-31
Hovmoller plot is a plot which has spatial information (keeping either x or y constant and varying y or x ) along X-axes and a variable evolution with time on y -axes.
I hope the above steps will help you.
salah morsi
2019-8-19
编辑:salah morsi
2019-8-19
creat a 3d meshgrid, using ur variables x , y ,z, then using contourf, u should be able to generate the diagram, i hope this helps, if not i can provide more details
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!