Grammar of Graphics for Kotlin
gggrid()
function (docs), as a replacement for earlier variant of gggrid().
ggsize()
See: example notebook.
jointPlot()
.
See: example notebook.
Axis position
parameter in position scales scaleX*(), scaleY*()
.
See: example notebook.
Drawing quantile lines and filling quantile areas in geomViolin()
and geomDensity()
.
See: example notebook.
angle
parameter in elementText()
in theme()
.
See: example notebook.
Additional "color" aesthetics: paint_a, paint_b, paint_c
.
These aesthetics are flexible and can be used as either "color" or "fill" as needed.
See Multiple Color Scales demo.
Also added a set of related "color scale" functions with the "aesthetic" parameter for configuring of additional color scales.
See New "Scale" Functions demo.
density2d
and density2df
geometry types in residualPlot()
.
[BREAKING] geomViolin()
no longer supports parameter drawQuantiles
. Use new quantileLines
and quantiles
parameters as needed.
[BREAKING] stack
and fill
position adjustments now stack objects on top of each other only if these objects belong to different groups.
If necessary, use mode="all"
in positionStack()
or positionFill()
to stack objects regardless of their group.
See: example notebook.
[BREAKING] The deprecation level raised to "ERROR" for all API that was deprecated in v. 4.2.0 and earlier.
[DEPRECATED] The earlier variant of gggrid().
From now-on please use new variant added in this release: new gggrid().
Sampling: drastically increased default N for "pick sampling" and for other types of sampling [#687].
..quantile..
aesthetic change [#658].position='stack'
[#673].residualPlot()
.
See: example notebook.
geomAreaRidges()
.
See: example notebook.
geomPie()
.
See: example notebook.
Annotations for pie chart:
See: example notebook.
New variables computed by 'count' and 'count2d' statistics: '..sum..', '..prop..', '..proppct..'.
See: example notebook.
geomImshow()
.
See: image_101, image_fisher_boat, image_grayscale, image_extent
New parameters in geomViolin()
:
tailsCutoff
(example notebook)showHalf
(example notebook)Static maps:
useCRS
parameter with value "provided" for geomMap()
and other geoms, working with SpatialDataset
.
See: example notebook.
In geomText(), geomLabel()
:
\n
) now works as line break
lineheight
aestheticnudgeX, nudgeY
parametersvjust
and hjust
): "inward"
and "outward"
See: example notebook.
vjust
parameter in positionStack()
and positionFill()
.
See: example notebook.
Deprecated API:
positionStack
, new usage: positionStack()
positionFill
, new usage: positionFill()
geomBoxplot()
: default value for parameter whiskerWidth
is 0.5.
Upgraded Kotlin version to 1.7.20 (was 1.6.21).
Upgraded Lets-Plot version to 2.5.1 (was 2.5.0).
See Lets-Plot What is new in 2.5.1 for more details.
elementBlank()
has no effect in theme legendTitle
[#608].-
, /
, \
or |
present.New theme: themeBW()
.
See: example notebook.
Color schemes (flavors) applicable to existing themes:
flavorDarcula()
flavorSolarizedLight()
flavorSolarizedDark()
flavorHighContrastLight()
flavorHighContrastDark()
See: example notebook.
Viridis color scales: scaleColorViridis()
, scaleFillViridis()
.
See: example notebook.
New parameters in theme's elementText()
:
size, family
(example notebook)hjust, vjust
for plot title, subtitle, caption, legend and axis titles
(example notebook)margin
for plot title, subtitle, caption, axis titles and tick labels
(example notebook)Parameter whiskerWidth
in geomBoxplot()
.
See: example notebook.
New geometry geomLabel()
.
See: example notebook.
New tooltip style after applying coordFlip()
[#580].
See: example notebook.
geomBoxplot
with zero height [#563].geomText
: wrong label alignment with hjust
0 and 1 [#592].breaks
parameter in scales [#507]BREAKING CHANGES: Due to refactorings performed in the source code, the v4.0.0 is no longer backward compatible with earlier versions of the Lets-Plot Kotlin API.
org.jetbrains.letsPlot
to a more specific subpackages:
themes
coord
pos
identity, stack, fill, dodge, nudge
and jitterdodge
(defined in the Pos
object),
are now deprecated in favor of the correspondent top level elements defined in the (new) org.jetbrains.letsPlot.pos
package:
positionIdentity, positionStack, positionFill, positionDodge(), positionNudge()
and positionJitterDodge()
.In Kotlin project
import
statements: import jetbrains.letsPlot..
→ import org.jetbrains.letsPlot..
deprecation WARNING
and will offer to fix this
automatically.In Jupyter notebook
Pos.abc
expressions with their new equivalents:
Pos.identity
→ positionIdentity
Pos.stack
→ positionStack
Pos.fill
→ positionFill
Pos.dodge
→ positionDodge()
Pos.nudge
→ positionNudge()
Pos.jitterdodge
→ positionJitterDodge()
NOTE: If your notebook also uses another Kotlin library which depends on an older version of Lets-Plot, then the classloader may refuse to load classes from both libraries. If this is the case, then you will want to do NOT update your notebook to Lets-Plot v4.0.0 as yet:
- Make sure your notebook is not using the
%useLatestDescriptors
line magic- Make sure you are using Kotlin Jupyter Kernel version 0.11.0.95 (or earlier), which bundles a previous version of Lets-Plot.
Global theme configuring with LetsPlot.theme
property.
See: example notebook.
Quantile-Quantile (Q-Q) plot:
geomQQ()
geomQQLine()
geomQQ2()
geomQQ2Line()
statQQ()
statQQLine()
statQQ2()
statQQ2Line()
qqPlot()
See: example notebook.
Marginal plots: the ggmarginal()
function.
See: example notebook.
Parameter orientation
in geoms: bar, boxplot, density, histogram, freqpoly, smooth, violin
.
See: example notebook.
New in plot theme:
face
parameter in elementText()
.
See: example notebook.
panelBorder
parameter in theme()
[#542].
See: example notebook.
Tooltip theme options, new parameters in theme()
:
tooltip
- tooltip rectangle options;tooltipText, tooltipTitleText
- tooltip text options;axisTooltipText, axisTooltipTextX, axisTooltipTextY
- axis tooltip text options.See: example notebook.
scaleColorGradientN()
and scaleFillGradientN()
functions [#504].
See: example notebook.
kotlinx.datetime
support.
arrow
parameter in geomSegment
- specification for arrow heads, as created by arrow()
function.
geomImage()
removed as it is not yet production ready.geom_violin
switched from systematic
to pick
.density
and ydensity
stats [#62].geom_violin
: add missing parameters kernel
, bw
, adjust
, n
, fs_max
to signature and docstring.New geometries:
geomViolin()
See: example notebook.
geomDotplot()
See: example notebook.
geomYDotplot()
See: example notebook.
Plot subtitle and caption:
subtitle
parameter in ggtitle()
and labs()
,
caption
parameter in labs()
,
plotSubtitle
and plotCaption
parameters in theme()
.
See: example notebook.
Multi-line labels: The 'newline' character (\n
) now works as line break
in plot title, subtitle and caption, in legend's title and in tooltips.
In tooltip customization API: the title()
option defines a tooltip "title" text which will always appear above the rest of the tooltip content.
See: example notebook.
Parameter scales
in facetGrid()/facetWrap()
[#451,
#479].
See: example notebook.
color()
will be removed in one of the future releases.geom_histogram(stat='density')
.scaleXTime()
and scaleYTime()
.
See: example notebook.
plotBackground, legendBackground
parameters in theme()
[#485].
axisOntop, axisOntopX, axisOntopY
parameters in theme()
coord_fixed()
should adjust dimensions of "geom" panel accordingly [#478].coordFlip()
.
See: example notebook .
Date-time formatting support:
breaks
.See Out[7, 8, 10]
in
the example notebook
.
Pre-configured themes:
themeGrey(), themeLight(), themeClassic(), themeMinimal()
;themeMinimal2()
- the default theme, themeNone()
.Theme modification: more parameters were added to the theme()
function.
See: example notebook.
Note: fonts size, family and face still can not be configured.
CorrPlot()
function now also accepts pre-computed correlation coefficients.
Kotlin/JS IR: xxx.klib
artifacts are now available.
Theme.xxxBlank()
functions. Please use corresponding parameters in theme()
.Ordering categories:
New parameters added to the asDiscrete()
function:
orderBy
- name of the variable by which the ordering will be performed;order
- ordering direction: 1 for ascending direction and -1 for descending (default).See: as_discrete.