API引用

情节

geoplot.pointplot(projection=None, hue=None, cmap=None, norm=None, scheme=None, scale=None, limits=(1, 5), scale_func=None, legend=False, legend_var=None, legend_values=None, legend_labels=None, legend_kwargs=None, figsize=(8, 6), extent=None, ax=None, **kwargs)

地理空间散点图。

参数
  • df (GeoDataFrame) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections .

  • hue (None, Series, GeoSeries, iterable, or str, optional) -- 数据集中用来给点上色的列(或其他数据的一个表)。有关此参数以及后续其他与色调相关的参数的参考,请参见 Customizing Plots#Hue .

  • cmap (matplotlib color, optional) -- 如果 hue 是指定的, colormap 使用。

  • norm (function, optional) -- A colormap normalization function 在绘图前将应用于数据。

  • scheme (None or mapclassify object, optional) -- 如果 hue 指定了要使用的分类装箱方案。

  • scale (str or iterable, optional) -- 数据集中用来缩放输出点的列(或某些其他数据的一个iteable)。有关此参数和其他与比例相关的参数的参考,请参见 Customizing Plots#Scale .

  • limits ((min, max) tuple, optional) -- 如果 scale 设置了点的最小和最大大小。

  • scale_func (ufunc, optional) -- 如果 scale 设置时,用于确定每个点的大小的函数。参考请参见 Pointplot Scale Functions 演示。

  • legend (boolean, optional) -- 是否包含地图图例。有关此参数以及随后与图例相关的其他参数的参考,请参见 Customizing Plots#Legend .

  • legend_values (list, optional) -- 图例中要使用的数据值。

  • legend_labels (list, optional) -- 图例中要使用的数据标签。

  • legend_var ("hue" or "scale", optional) -- 哪个变量, huescale ,以便在图例中使用。

  • legend_kwargs (dict, optional) -- 要传递给基础图例的关键字参数。

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 要传递给基础 matplotlib.pyplot.scatter instance .

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

geoplot.polyplot(projection=None, extent=None, figsize=(8, 6), ax=None, **kwargs)

琐碎的多边形绘图。

参数
  • df (GeoDataFrame) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections .

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 传递给基础matplotlib的关键字参数 Polygon patches .

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

geoplot.webmap(extent=None, figsize=(8, 6), projection=None, zoom=None, provider={'attribution': '(C) OpenStreetMap contributors', 'max_zoom': 19, 'name': 'OpenStreetMap.Mapnik', 'url': 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'}, ax=None, **kwargs)

网络地图。

参数
  • df (GeoDataFrame) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections . webmap 仅支持单个投影: WebMercator .

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • zoom (None or int) -- 获取webmap分幅时要使用的缩放级别。更高的缩放级别意味着更多的细节,但也需要更长的时间来生成,将有更多的混乱。通常只有两个或三个缩放级别适用于任何给定区域。有关参考信息,请参见上的OpenStreetMaps参考 zoom levels .

  • provider (contextily.providers object) -- 磁贴提供程序。如果未设置提供程序,则默认的OpenStreetMap平铺服务,contextly.providers.OpenStreetMap将使用.Mapnik。参考请参见 the contextily documentation .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 传递给基础matplotlib的关键字参数 Polygon patches .

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

geoplot.choropleth(projection=None, hue=None, cmap=None, norm=None, scheme=None, legend=False, legend_kwargs=None, legend_labels=None, legend_values=None, extent=None, figsize=(8, 6), ax=None, **kwargs)

颜色映射的区域图。

参数
  • df (GeoDataFrame) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections .

  • hue (None, Series, GeoSeries, iterable, or str, optional) -- 数据集中用来给点上色的列(或其他数据的一个表)。有关此参数以及后续其他与色调相关的参数的参考,请参见 Customizing Plots#Hue .

  • cmap (matplotlib color, optional) -- 这个 colormap 使用。

  • norm (function, optional) -- A colormap normalization function 在绘图前将应用于数据。

  • scheme (None or mapclassify object, optional) -- 要使用的分类装箱方案。

  • legend (boolean, optional) -- 是否包含地图图例。有关此参数以及随后与图例相关的其他参数的参考,请参见 Customizing Plots#Legend .

  • legend_values (list, optional) -- 图例中要使用的数据值。

  • legend_labels (list, optional) -- 图例中要使用的数据标签。

  • legend_kwargs (dict, optional) -- 要传递给基础图例的关键字参数。

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 要传递给基础 matplotlib Polygon patches .

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

geoplot.kdeplot(projection=None, extent=None, figsize=(8, 6), ax=None, clip=None, shade_lowest=False, **kwargs)

核密度估计等时线图。

参数
  • df (GeoDataFrame) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections .

  • cmap (matplotlib color, optional) -- 这个 colormap 使用。

  • clip (None or iterable or GeoSeries, optional) -- 如果指定,等时线将被剪裁到此几何体的边界。

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 要传递给的关键字参数 the underlying seaborn.kdeplot instance .

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

geoplot.cartogram(projection=None, scale=None, limits=(0.2, 1), scale_func=None, hue=None, cmap=None, norm=None, scheme=None, legend=False, legend_values=None, legend_labels=None, legend_kwargs=None, legend_var=None, extent=None, figsize=(8, 6), ax=None, **kwargs)

缩放面积图。

参数
  • df (GeoDataFrame) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections .

  • scale (str or iterable, optional) -- 数据集中用来缩放输出点的列(或某些其他数据的一个iteable)。有关此参数和其他与比例相关的参数的参考,请参见 Customizing Plots#Scale .

  • limits ((min, max) tuple, optional) -- 如果 scale 设置了点的最小和最大大小。

  • scale_func (ufunc, optional) -- 如果 scale 设置时,用于确定每个点的大小的函数。参考请参见 Pointplot Scale Functions 演示。

  • hue (None, Series, GeoSeries, iterable, or str, optional) -- 数据集中用来给点上色的列(或其他数据的一个表)。有关此参数以及后续其他与色调相关的参数的参考,请参见 Customizing Plots#Hue .

  • cmap (matplotlib color, optional) -- 如果 hue 是指定的, colormap 使用。

  • norm (function, optional) -- A colormap normalization function 在绘图前将应用于数据。

  • scheme (None or mapclassify object, optional) -- 如果 hue 指定了要使用的分类装箱方案。

  • legend (boolean, optional) -- 是否包含地图图例。有关此参数以及随后与图例相关的其他参数的参考,请参见 Customizing Plots#Legend .

  • legend_values (list, optional) -- 图例中要使用的数据值。

  • legend_labels (list, optional) -- 图例中要使用的数据标签。

  • legend_var ("hue" or "scale", optional) -- 哪个变量, huescale ,以便在图例中使用。

  • legend_kwargs (dict, optional) -- 要传递给基础图例的关键字参数。

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 要传递给基础 matplotlib Polygon patches .

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

geoplot.sankey(projection=None, hue=None, norm=None, cmap=None, scheme=None, legend=False, legend_kwargs=None, legend_labels=None, legend_values=None, legend_var=None, extent=None, figsize=(8, 6), scale=None, scale_func=None, limits=(1, 5), ax=None, **kwargs)

一张空间地图或流程图。

参数
  • df (GeoDataFrame, optional) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections .

  • hue (None, Series, GeoSeries, iterable, or str, optional) -- 数据集中用来给点上色的列(或其他数据的一个表)。有关此参数以及后续其他与色调相关的参数的参考,请参见 Customizing Plots#Hue .

  • cmap (matplotlib color, optional) -- 如果 hue 是指定的, colormap 使用。

  • norm (function, optional) -- A colormap normalization function 在绘图前将应用于数据。

  • scheme (None or mapclassify object, optional) -- 如果 hue 指定了要使用的分类装箱方案。

  • scale (str or iterable, optional) -- 数据集中用来缩放输出点的列(或某些其他数据的一个iteable)。有关此参数和其他与比例相关的参数的参考,请参见 Customizing Plots#Scale .

  • limits ((min, max) tuple, optional) -- 如果 scale 设置了点的最小和最大大小。

  • scale_func (ufunc, optional) -- 如果 scale 设置时,用于确定每个点的大小的函数。参考请参见 Pointplot Scale Functions 演示。

  • legend (boolean, optional) -- 是否包含地图图例。有关此参数以及随后与图例相关的其他参数的参考,请参见 Customizing Plots#Legend .

  • legend_values (list, optional) -- 图例中要使用的数据值。

  • legend_labels (list, optional) -- 图例中要使用的数据标签。

  • legend_var ("hue" or "scale", optional) -- 哪个变量, huescale ,以便在图例中使用。

  • legend_kwargs (dict, optional) -- 要传递给基础图例的关键字参数。

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 要传递给的关键字参数 the underlying matplotlib.lines.Line2D 实例。

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

geoplot.quadtree(projection=None, clip=None, hue=None, cmap=None, norm=None, scheme=None, nmax=None, nmin=None, nsig=0, agg=<function mean>, legend=False, legend_kwargs=None, legend_values=None, legend_labels=None, extent=None, figsize=(8, 6), ax=None, **kwargs)

有点聚居区的合唱团。

参数
  • df (GeoDataFrame) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections .

  • clip (None or iterable or GeoSeries, optional) -- 如果指定,四边形将被剪裁到此几何体的边界。

  • hue (None, Series, GeoSeries, iterable, or str, optional) -- 数据集中用来给点上色的列(或其他数据的一个表)。有关此参数以及后续其他与色调相关的参数的参考,请参见 Customizing Plots#Hue .

  • cmap (matplotlib color, optional) -- 如果 hue 是指定的, colormap 使用。

  • norm (function, optional) -- A colormap normalization function 在绘图前将应用于数据。

  • scheme (None or mapclassify object, optional) -- 要使用的分类装箱方案。

  • nmax (int or None, optional) -- 四边形中观察的最大数目。

  • nmin (int, optional) -- 四边形中观察的最小数目。

  • nsig (int, optional) -- 四边形中观察的最小数目。默认值为0(仅删除空修补程序)。

  • agg (function, optional) -- 用于颜色映射的聚合函数。默认为 np.mean .

  • legend (boolean, optional) -- 是否包含地图图例。有关此参数以及随后与图例相关的其他参数的参考,请参见 Customizing Plots#Legend .

  • legend_values (list, optional) -- 图例中要使用的数据值。

  • legend_labels (list, optional) -- 图例中要使用的数据标签。

  • legend_kwargs (dict, optional) -- 要传递给基础图例的关键字参数。

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 要传递给基础 matplotlib Polygon patches .

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

geoplot.voronoi(projection=None, clip=None, hue=None, cmap=None, norm=None, scheme=None, legend=False, legend_kwargs=None, legend_labels=None, legend_values=None, extent=None, edgecolor='black', figsize=(8, 6), ax=None, **kwargs)

地理空间沃罗诺图。

参数
  • df (GeoDataFrame) -- 正在绘制的数据。

  • projection (geoplot.crs object instance, optional) -- 要使用的投影。参考请参见 Working with Projections .

  • clip (None or iterable or GeoSeries, optional) -- 如果指定,输出将被剪裁到此几何体的边界。

  • hue (None, Series, GeoSeries, iterable, or str, optional) -- 数据集中用来给点上色的列(或其他数据的一个表)。有关此参数以及后续其他与色调相关的参数的参考,请参见 Customizing Plots#Hue .

  • cmap (matplotlib color, optional) -- 如果 hue 是指定的, colormap 使用。

  • norm (function, optional) -- A colormap normalization function 在绘图前将应用于数据。

  • scheme (None or mapclassify object, optional) -- 如果 hue 指定了要使用的分类装箱方案。

  • scale (str or iterable, optional) -- 数据集中用来缩放输出点的列(或某些其他数据的一个iteable)。有关此参数和其他与比例相关的参数的参考,请参见 Customizing Plots#Scale .

  • limits ((min, max) tuple, optional) -- 如果 scale 设置了点的最小和最大大小。

  • scale_func (ufunc, optional) -- 如果 scale 设置时,用于确定每个点的大小的函数。参考请参见 Pointplot Scale Functions 演示。

  • legend (boolean, optional) -- 是否包含地图图例。有关此参数以及随后与图例相关的其他参数的参考,请参见 Customizing Plots#Legend .

  • legend_values (list, optional) -- 图例中要使用的数据值。

  • legend_labels (list, optional) -- 图例中要使用的数据标签。

  • legend_var ("hue" or "scale", optional) -- 哪个变量, huescale ,以便在图例中使用。

  • legend_kwargs (dict, optional) -- 要传递给基础图例的关键字参数。

  • extent (None or (min_longitude, min_latitude, max_longitude, max_latitude), optional) -- 控制打印范围。参考请参见 Customizing Plots#Extent .

  • figsize ((x, y) tuple, optional) -- 设置打印图形的大小(以英寸为单位)。

  • ax (AxesSubplot or GeoAxesSubplot instance, optional) -- 如果设置, matplotlib.axes.AxesSubplotcartopy.mpl.geoaxes.GeoAxesSubplot 实例来绘制绘图。默认为新轴。

  • kwargs (dict, optional) -- 要传递给基础 matplotlib Line2D objects .

返回

打印轴。

返回类型

AxesSubplot or GeoAxesSubplot

预测

crs.PlateCarree()

形成以经度为中心的CRS。

crs.LambertCylindrical()

形成以经度为中心的CRS。

crs.Mercator()

形成以经度为中心的CRS。

crs.WebMercator()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.Miller()

形成以经度为中心的CRS。

crs.Mollweide()

形成以经度为中心的CRS。

crs.Robinson()

形成以经度为中心的CRS。

crs.Sinusoidal()

形成以经度为中心的CRS。

crs.InterruptedGoodeHomolosine()

形成以经度为中心的CRS。

crs.Geostationary()

形成以经度为中心的CRS。

crs.NorthPolarStereo()

形成以经度为中心的CRS。

crs.SouthPolarStereo()

形成以经度为中心的CRS。

crs.AlbersEqualArea()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.AzimuthalEquidistant()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.LambertConformal()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.Orthographic()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.Stereographic()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.TransverseMercator()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.LambertAzimuthalEqualArea()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.UTM()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

crs.OSGB()

形成一个既不接受经度也不接受纬度居中的CRS。

crs.EuroPP()

形成一个既不接受经度也不接受纬度居中的CRS。

crs.OSNI()

生成的实例 cartopy.crs . name 在哪里? name 匹配实例的类名。

参数
  • load (Return a Cartopy CRS initialized with defaults from the centerings dictionary,) --

  • by initialization parameters. (overridden) --

  • _as_mpl_axes (Return the result of calling cartopy's _as_mpl_axes for self.load) --

  • with empty df and centerings. (called) --

公用事业

datasets.get_path()

返回适合读入的示例数据集的URL路径 geopandas .