【发布时间】:2021-04-28 12:19:38
【问题描述】:
在使用 geopandas (Python3) 创建的墨卡托地图中,坐标轴旁边的经度和纬度比例不正确。
我用这样的地理熊猫制作了一张墨卡托投影地图。
import geopandas as gpd
import matplotlib.pyplot as plt
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world = world[(world.name != "Antarctica") & (world.name != "Fr. S. Antarctic Lands")]
world = world.to_crs("EPSG:3395")
ax = world.plot()
ax.set_title("Mercator")
plt.show()
地图本身输出正确,但坐标轴旁边的经度/纬度比例不正确,如下图所示。
经度的范围应该是 -180 到 180,纬度的范围应该是 -90 到 90。但是,图像中的比例不是这样。
我怎样才能得到正确的输出比例?
【问题讨论】:
-
请直接在帖子中添加您的图片,而不是作为链接
-
看起来您的绘图中的坐标以米为单位,地球的周长约为 4x10^7 米。事实上 EPSG:3395 有米的单位,见epsg.io/3395
标签: python python-3.x matplotlib geopandas