plotInset
Parameter in theme()
¶The plotInset
parameter in theme()
specifies the inset for a plotting area, including the axes with their labels, but without titles.
The parameter is set according to the margin rules: accept a number or a list of numbers.
%useLatestDescriptors
%use lets-plot
LetsPlot.getInfo()
Lets-Plot Kotlin API v.4.8.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.4.1.
val start = -Math.PI
val stop = Math.PI
val num = 100
val step = ((stop - start) / (num - 1))
val x = List(num) { start + it * step }
val data = mapOf(
"x" to x,
"y" to x.map{Math.sin(it)}
)
val p = letsPlot(data) { x = "x"; y = "y" } +
geomLine() +
ggtitle("Sine wave") +
themeLight() +
theme(plotBackground = elementRect(size = 1))
gggrid(listOf(
p,
p + theme(plotInset = 20)
))
gggrid(listOf(
p + theme(axis = elementBlank()),
p + theme(axis = elementBlank()) + theme(plotInset = listOf(0, 30))
))