cityImage.plot_grid_gdf_columns#
- cityImage.plot_grid_gdf_columns(gdf, columns=[], ncols=1, nrows=1, titles=[], black_background=True, figsize=(15, 15), scheme=None, bins=None, classes=None, norm=None, cmap=None, color=None, alpha=None, geometry_size=None, geometry_size_columns=[], geometry_size_factor=None, legend=False, fontsize=15, cbar=False, cbar_ticks=5, cbar_max_symbol=False, cbar_min_max=False, cbar_shrink=0.75, axes_frame=False)[source]#
It plots the geometries of a GeoDataFrame, coloring on the bases of the values contained in two or more provided columns, using a given scheme. When no columns are provided, the function raises an error.
The other parameters regulate colorbar, legend, etc (no basemap here). Use this function for plotting in relation to more than one column, for a single GeoDataFrame.
- Parameters:
gdf (GeoDataFrame) – GeoDataFrame to be plotted.
columns (list of str) – The list of column on which the plot is based.
ncols (int) – The number of desired columns for organising the subplots.
nrows (int) – The number of desired rows for organising the subplots.
titles (list of str) – Title of the plot.
black_background (boolean) – Black background or white.
fig_size (float) – Size figure extent.
scheme (str) – Classification method. Choose amongst the options listed at https://pysal.org/mapclassify/api.html.
bins (list) – Bins defined by the user.
classes (int) – Number of classes for categorizing the data when scheme is not “None”.
norm (array) – A class that specifies a desired data normalization into a [min, max] interval.
cmap (str or matplotlib.colors.LinearSegmentedColormap) – Color map for the plot. See matplotlib colormaps for a list of possible values or pass a colormap.
color (str) – Categorical color applied to all geometries when not using a column to color them.
alpha (float) – Alpha value of the plotted layer.
geometry_size (float) – Point size value when plotting a Point GeoDataFrame or Width value when plotting LineString GeoDataFrame.
geometry_size_columns (List of str) – The column name(s) in the GeoDataFrame to be used for scaling the geometry size.
geometry_size_factor (float) – Rescaling factor for the column provided, if any. The column is rescaled from 0 to 1, and the geometry_size_factor is used to rescale the marker size accordingly (e.g., rescaled variable’s value [0-1] * factor) when plotting a Point GeoDataFrame.
legend (bool) – When True, show the legend.
fontsize (int) – Font size.
cbar (bool) – If True, show the colorbar; otherwise, don’t. When True, the legend is not shown.
cbar_ticks (int) – Number of ticks along the colorbar.
cbar_max_symbol (bool) – If True, show the “>” next to the highest tick’s label in the colorbar (useful when normalizing).
cbar_min_max (bool) – If True, only show the “>” and “<” as labels of the lowest and highest ticks’ the colorbar.
cbar_shrink – Fraction by which to multiply the size of the colorbar.
axes_frame (bool) – If True, show the axes’ frame.
- Returns:
fig – the resulting figure
- Return type:
matplotlib.figure.Figure object