将不同位置的数据绘制为等高线图
Plot data in different locations as a contour map
我有很多位置的数据,我想在不同位置绘制这些数据作为等高线图或任何不同的样式。这是我拥有的数据示例:
Date Lat Lon Concentration
1950 2 2 5
Date Lat Lon Concentration
1950 2 2.25 7
Date Lat Lon Concentration
1950 2 2.5 8
.
.
.
我想绘制一个热图或等高线图来显示每个位置的浓度。
有什么建议吗?
您可以使用来自 MATLAB 文件交换 here 的 plot_google_maps
函数。这将创建一个带有世界地图的绘图,因为背景放大到 Lat
和 Lon
坐标的范围。在那里,您可以使用颜色条绘制散点图。
% extract your latitude, longitude data from your input file (which I do not have)
% lat = <your latitude data>
% lon = <your longitude data>
% Your z-values for the heatmap (Concentration). I used random number here
concentration = rand(size(lat));
% Plot a scatter plot with a colorscaling on concentration
scatter(lat,lon,50,concentration,'o','filled')
% Add colorbar
colorbar
% Add google map section of your lat and lon data as background on the plot
plot_google_map
这给出了类似的东西
我有很多位置的数据,我想在不同位置绘制这些数据作为等高线图或任何不同的样式。这是我拥有的数据示例:
Date Lat Lon Concentration
1950 2 2 5
Date Lat Lon Concentration
1950 2 2.25 7
Date Lat Lon Concentration
1950 2 2.5 8
.
.
.
我想绘制一个热图或等高线图来显示每个位置的浓度。
有什么建议吗?
您可以使用来自 MATLAB 文件交换 here 的 plot_google_maps
函数。这将创建一个带有世界地图的绘图,因为背景放大到 Lat
和 Lon
坐标的范围。在那里,您可以使用颜色条绘制散点图。
% extract your latitude, longitude data from your input file (which I do not have)
% lat = <your latitude data>
% lon = <your longitude data>
% Your z-values for the heatmap (Concentration). I used random number here
concentration = rand(size(lat));
% Plot a scatter plot with a colorscaling on concentration
scatter(lat,lon,50,concentration,'o','filled')
% Add colorbar
colorbar
% Add google map section of your lat and lon data as background on the plot
plot_google_map
这给出了类似的东西