plot-api / jetbrains.letsPlot.geom / geom_polygon

geom_polygon

class geom_polygon : PolygonAesthetics, LayerBase

Display a polygon (filled path). geom_polygon draws polygons, which are filled paths. Each vertex of the polygon requires a separate row in the data.

Parameters

data - dictionary or pandas DataFrame, optional. The data to be displayed in this layer. If None, the default, the data is inherited from the plot data as specified in the call to lets_plot.

stat - string, optional. The statistical transformation to use on the data for this layer, as a string. Supported transformations: "identity" (leaves the data unchanged), "count" (counts number of points with same x-axis coordinate), "bin" (counts number of points with x-axis coordinate in the same bin), "smooth" (performs smoothing - linear default)

position - string, optional. Position adjustment, either as a string ("identity", "stack", "dodge", ...), or the result of a call to a position adjustment function.

map - dictionary, pandas DataFrame or GeoDataFrame (supported shapes Polygon and MultiPolygon) Data (Dictionary, DataFrame or GeoDataFrame object) contains coordinates of polygon vertices on map. Can be used with aesthetic parameter 'map_id' for joining data and map coordinates. Dictionary and DataFrame object must contain keys/columns: 1. 'x' or 'lon' or 'long' 2. 'y' or 'lat'

map_join - str, pair, optional Pair of names used to join map coordinates with data. str or first value in pair - column in data second value in pair - column in map

x - x-axis coordinates of the vertices of the polygon.

y - y-axis coordinates of the vertices of the polygon.

alpha - transparency level of a layer. Understands numbers between 0 and 1.

color - (colour) color of a geometry lines. Can be continuous or discrete. For continuous value this will be a color gradient between two colors.

size - lines width. Defines line width.

linetype - type of the line of tile's border. Codes and names: 0 = "blank", 1 = "solid", 2 = "dashed", 3 = "dotted", 4 = "dotdash", 5 = "longdash", 6 = "twodash".

fill - color of geometry filling.

mapping - set of aesthetic mappings. Aesthetic mappings describe the way that variables in the data are mapped to plot "aesthetics".

Constructors

<init>

Display a polygon (filled path). geom_polygon draws polygons, which are filled paths. Each vertex of the polygon requires a separate row in the data.

geom_polygon(data: Map<*, *>? = null, stat: StatOptions = Stat.identity, position: PosOptions = Pos.identity, showLegend: Boolean = true, sampling: SamplingOptions? = null, x: Double? = null, y: Double? = null, size: Double? = null, linetype: Any? = null, color: Any? = null, fill: Any? = null, alpha: Double? = null, mapping: PolygonMapping.() -> Unit = {})

Properties

alpha

transparency level of a layer. Understands numbers between 0 and 1.

val alpha: Double?

color

(colour) color of a geometry lines. Can be continuous or discrete. For continuous value this will be a color gradient between two colors.

val color: Any?

fill

color of geometry filling.

val fill: Any?

linetype

type of the line of tile's border. Codes and names: 0 = "blank", 1 = "solid", 2 = "dashed", 3 = "dotted", 4 = "dotdash", 5 = "longdash", 6 = "twodash".

val linetype: Any?

size

lines width. Defines line width.

val size: Double?

x

x-axis coordinates of the vertices of the polygon.

val x: Double?

y

y-axis coordinates of the vertices of the polygon.

val y: Double?

Extension Functions

toSpec

fun Layer.toSpec(): MutableMap<String, Any>