MetPy - PlotGeometry()
#
Make raster plots by defining relevant traits.
PlotGeometry()
#
Attribute |
Description |
---|---|
Fill color(s) for polygons and points.Fill color(s) for polygons and points. |
|
A collection of Shapely objects to plot. |
|
Outline color(s) for labels. |
|
Font color(s) for labels. |
|
An integer or string value for the font size of labels. |
|
A collection of labels corresponding to plotted geometry. |
|
Symbol used to denote points. |
|
Supply a dictionary of valid Matplotlib keyword arguments to modify how the plot variable is drawn. |
|
Stroke color(s) for polygons and line color(s) for lines. |
|
Stroke width(s) for polygons and lines. |
Attribute Descriptions#
fill#
Fill color(s) for polygons and points.
A single string (color name or hex code) or collection of strings with which to fill polygons and points. If a collection, the first color corresponds to the first Shapely object in
geometry
, the second color corresponds to the second Shapely object, and so on. Iffill
is shorter thangeometry
,fill
cycles back to the beginning, repeating the sequence of colors as needed. Default value is lightgray.
geometry#
A collection of Shapely objects to plot.
A collection of Shapely objects, such as the ‘geometry’ column from a
geopandas.GeoDataFrame
. Acceptable Shapely objects areshapely.MultiPolygon
,shapely.Polygon
,shapely.MultiLineString
,shapely.LineString
,shapely.MultiPoint
, andshapely.Point
.
label_edgecolor#
Outline color(s) for labels.
A single string (color name or hex code) or collection of strings for the outline color of labels. If a collection, the first color corresponds to the label of the first Shapely object in
geometry
, the second color corresponds to the label of the second Shapely object, and so on. Default value isfill
.
label_fontcolor#
Font color(s) for labels.
A single string (color name or hex code) or collection of strings for the font color of labels. If a collection, the first color corresponds to the label of the first Shapely object in
geometry
, the second color corresponds to the label of the second Shapely object, and so on. Default value isfill
.
label_fontsize#
An integer or string value for the font size of labels.
Accepts size in points or relative size. Allowed relative sizes are those of Matplotlib: ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’.
labels#
A collection of labels corresponding to plotted geometry.
A collection of strings to use as labels for geometry, such as a column from a
Geopandas.GeoDataFrame
. The first label corresponds to the first Shapely object ingeometry
, the second label corresponds to the second Shapely object, and so on. The length oflabels
must be equal to the length ofgeometry
. Labels are positioned along the edge of polygons, and below lines and points. No labels are plotted if this attribute is left undefined, or set equal to None.
marker#
Symbol used to denote points.
Accepts any matplotlib marker. Default value is ‘.’, which plots a dot at each point.
mpl_args#
This attribute can be set to a dictionary containing keyword arguments (kwarg) valid for the various Matplotlib plotting functions to enhance how a plot is created. For example, you can use this attribute to set the
zorder
kwarg to alter what aspects of the your plot are on top of one another. NOTE: Setting the mpl_args trait will override any other trait that corresponds to a specific kwarg for the particular plot type (e.g., linecolor, linewidth).
stroke#
Stroke color(s) for polygons and line color(s) for lines.
A single string (color name or hex code) or collection of strings with which to outline polygons and color lines. If a collection, the first color corresponds to the first Shapely object in
geometry
, the second color corresponds to the second Shapely object, and so on. Ifstroke
is shorter thangeometry
,stroke
cycles back to the beginning, repeating the sequence of colors as needed. Default value is black.
stroke_width#
Stroke width(s) for polygons and lines.
A single integer or floating point value or collection of values representing the size of the stroke width. If a collection, the first value corresponds to the first Shapely object in
geometry
, the second value corresponds to the second Shapely object, and so on. Ifstroke_width
is shorter thangeometry
,stroke_width
cycles back to the beginning, repeating the sequence of values as needed. Default value is 1.