可以利用julia的GeoMakie库绘制出全球地壳深度的分布图
代码架构类似于
1 | using GeoMakie,CairoMakie |
成图效果如下
利用地壳深度的数据,利用heatmap
函数可以成图 1
2heatmap!(ga,lons,lats,matrix_data,colormap = :diverging_bwr_40_95_c42_n256)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28% Load data
file_path = 'organized_data_matrix.txt';
data = readtable(file_path, 'Delimiter', '\t');
lons = -179.5:1:179.5;
lats = -89.5:1:89.5;
% Convert table to matrix
matrix_data = table2array(data);
% Create a map figure
figure;
% Set up a map axes with 'Mollweide' projection
ax = axesm('MapProjection', 'mollweid', 'Grid', 'on', 'Frame', 'on');
% Adjust range of the map
setm(ax, 'MapLatLimit', [-90 90], 'MapLonLimit', [-180 180]);
% Plot the data as a surface
surfm(lats, lons, matrix_data'); % transpose matrix_data if necessary
% Customize the colormap
colormap(ax, jet); % You can choose any colormap that fits your data visualization needs
% Add coastlines
coast = load('coastlines');
% Show the configured map
tightmap;