忽略无花果和无花果的大小

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

我尝试在地图上绘制2个点:

import geopandas as gp
from shapely.geometry import Point

points = {'name': ['point1','point2'],
          'geometry': [Point(37.710624, 55.859523), Point(37.705523,55.675104)]
         }
gdf = gp.GeoDataFrame(points, columns = ['name', 'geometry'],crs="epsg:4326")
gdf.plot(color="red", figsize=(5,5))

result

为什么结果不是5X5,我该如何解决?

matplotlib geopandas
1个回答
0
投票

得到的数字是5高。 GeoPandas图通常限于几何图形,您不能自己指定图形的纵横比(以0.8表示),以避免几何图形的变形。如果要在两点周围显示一些空白区域,则需要为轴设置特定的xlim限制。如果您的点是水平分布的,则需要ylim。另外,您也可以同时设置两者。

ax = gdf.plot(color="red", figsize=(5,5))
ax.set_xlim(37.6, 37.8)

enter image description here

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