我想让网格尺寸变得密集,用0.25*0.25度的方格,该怎么办?

问题描述 投票:0回答:1

输入下面的代码可以可视化显示纬度和经度的世界地图,但网格尺寸太宽。我想把它密集地画成0.25*0.25度的正方形大小,该怎么办?

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import numpy as np

proj=ccrs.PlateCarree()
fig, ax = plt.subplots(1, 1, subplot_kw={'projection':proj})
ax.coastlines()
gl=ax.gridlines(draw_labels=True)
matplotlib cartopy
1个回答
0
投票

您可以使用

ax.set_extent([lon_0, lon_1, lat_0, lat_1])
(或
ax.set_xlim()
ax.set_ylim()
)简单地设置地图位置。海岸线等功能会自动缩放到更高分辨率,您可以使用下面的代码进行测试,方法是将
resolution='10m'
更改为例如
resolution='110m'

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import numpy as np

proj=ccrs.PlateCarree()
fig, ax = plt.subplots(1, 1, subplot_kw={'projection':proj})
ax.set_extent([3.3, 4.3, 51.2, 52.2])
ax.coastlines(resolution='10m')
ax.gridlines(draw_labels=True)

© www.soinside.com 2019 - 2024. All rights reserved.