plot-api / jetbrains.letsPlot.geom / geom_density2d

geom_density2d

class geom_density2d : PathAesthetics, ContourStatAesthetics, Density2dStatAesthetics, Density2dStatParameters, LayerBase

Display density function contour.

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.

tooltips - result of the call to the layer_tooltips() function. Specifies appearance, style and content.

kernel - string, optional. The kernel we use to calculate the density function. Choose among "gaussian", "cosine", "optcosine", "rectangular" (or "uniform"), "triangular", "biweight" (or "quartic"), "epanechikov" (or "parabolic")

bw - string or double array, optional. The method (or exact value) of bandwidth. Either a string (choose among "nrd0" and "nrd"), or a double array of length 2.

adjust - double, optional. Adjust the value of bandwidth my multiplying it. Changes how smooth the frequency curve is.

n - int array, optional. The number of sampled points for plotting the function (on x and y direction correspondingly)

contour - Boolean, optional.

bins - int, optional. Number of levels.

binWidth - double, optional. Distance between levels.

x - x-axis coordinates of the center of rectangles, forming a tessellation.

y - y-axis coordinates of the center of rectangles, forming a tessellation.

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

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

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

size - line width.

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

Constructors

<init>

Display density function contour.

geom_density2d(data: Map<*, *>? = null, stat: StatOptions = Stat.density2d(), position: PosOptions = Pos.identity, showLegend: Boolean = true, sampling: SamplingOptions? = null, tooltips: TooltipOptions? = null, x: Double? = null, y: Double? = null, z: Double? = null, alpha: Number? = null, color: Any? = null, linetype: Any? = null, size: Number? = null, speed: Double? = null, flow: Double? = null, weight: Double? = null, bw: Any? = null, kernel: String? = null, n: Int? = null, adjust: Number? = null, contour: Boolean? = null, bins: Int? = null, binWidth: Number? = null, mapping: Density2dMapping.() -> Unit = {})

Properties

adjust

double, optional. Adjust the value of bandwidth my multiplying it. Changes how smooth the frequency curve is.

val adjust: Number?

alpha

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

val alpha: Number?

bins

int, optional. Number of levels.

val bins: Int?

binWidth

double, optional. Distance between levels.

val binWidth: Number?

bw

string or double array, optional. The method (or exact value) of bandwidth. Either a string (choose among "nrd0" and "nrd"), or a double array of length 2.

val bw: Any?

color

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

val color: Any?

contour

Boolean, optional.

val contour: Boolean?

flow

val flow: Double?

kernel

string, optional. The kernel we use to calculate the density function. Choose among "gaussian", "cosine", "optcosine", "rectangular" (or "uniform"), "triangular", "biweight" (or "quartic"), "epanechikov" (or "parabolic")

val kernel: String?

linetype

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

val linetype: Any?

n

int array, optional. The number of sampled points for plotting the function (on x and y direction correspondingly)

val n: Int?

size

line width.

val size: Number?

speed

val speed: Double?

weight

val weight: Double?

x

x-axis coordinates of the center of rectangles, forming a tessellation.

val x: Double?

y

y-axis coordinates of the center of rectangles, forming a tessellation.

val y: Double?

z

val z: Double?

Functions

seal

fun seal(): Options

Extension Functions

toSpec

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