Plot a Point/MultiPoint or the vertices of any other geometry type. Parameters ---------- geom : shapely.Geometry Any shapely Geometry object, from which all vertices are extracted and plotted. ax : matplotlib Axes, default None The axes on which to draw the
(geom, ax=None, color=None, marker="o", **kwargs)
| 189 | |
| 190 | |
| 191 | def plot_points(geom, ax=None, color=None, marker="o", **kwargs): |
| 192 | """Plot a Point/MultiPoint or the vertices of any other geometry type. |
| 193 | |
| 194 | Parameters |
| 195 | ---------- |
| 196 | geom : shapely.Geometry |
| 197 | Any shapely Geometry object, from which all vertices are extracted |
| 198 | and plotted. |
| 199 | ax : matplotlib Axes, default None |
| 200 | The axes on which to draw the plot. If not specified, will get the |
| 201 | current active axes or create a new figure. |
| 202 | color : matplotlib color specification |
| 203 | Color for the filled points. You can use `markeredgecolor` and |
| 204 | `markerfacecolor` to have different edge and fill colors. |
| 205 | marker : str, default "o" |
| 206 | The matplotlib marker for the points. |
| 207 | **kwargs |
| 208 | Additional keyword arguments passed to matplotlib `plot` (Line2D). |
| 209 | |
| 210 | Returns |
| 211 | ------- |
| 212 | Matplotlib artist (Line2D) |
| 213 | |
| 214 | """ |
| 215 | if ax is None: |
| 216 | ax = _default_ax() |
| 217 | |
| 218 | coords = shapely.get_coordinates(geom) |
| 219 | (line,) = ax.plot( |
| 220 | coords[:, 0], coords[:, 1], linestyle="", marker=marker, color=color, **kwargs |
| 221 | ) |
| 222 | return line |
searching dependent graphs…