%useLatestDescriptors
%use dataframe
%use lets-plot
LetsPlot.getInfo()
Lets-Plot Kotlin API v.4.9.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.5.1.
val iris_df = DataFrame.readCSV("https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/iris.csv")
iris_df.head()
DataFrame: rowsCount = 5, columnsCount = 5
sepal_length | sepal_width | petal_length | petal_width | species |
---|---|---|---|---|
5.100000 | 3.500000 | 1.400000 | 0.200000 | setosa |
4.900000 | 3.000000 | 1.400000 | 0.200000 | setosa |
4.700000 | 3.200000 | 1.300000 | 0.200000 | setosa |
4.600000 | 3.100000 | 1.500000 | 0.200000 | setosa |
5.000000 | 3.600000 | 1.400000 | 0.200000 | setosa |
val iris_dat = iris_df.toMap()
residualPlot(iris_dat, "petal_length", "petal_width")
method='none'
)¶residualPlot(iris_dat, "petal_length", "petal_width", method="none", hline=false) +
themeClassic()
residualPlot(iris_dat, "petal_length", "petal_width", geom="tile", marginal="hist:tr") + ggsize(600, 300)
residualPlot(iris_dat, "petal_length", "petal_width", method="loess", span=.25, maxN=25)
residualPlot(iris_dat, "petal_length", "petal_width", size=5, color="#feb24c", alpha=0.3)
residualPlot(iris_dat, "petal_length", "petal_width", geom="none", color="black", hline=false) +
geomHLine(yintercept=0, color="black") +
geomPoint(size=5, shape=21, color="black", fill="#feb24c")
residualPlot(iris_dat, "petal_length", "petal_width", hline=false, marginal="none") +
geomSmooth(method="loess", se=true, level=.99, seed=42)
residualPlot(iris_dat, "petal_length", "petal_width", marginal="box:lb:.03,hist:t:.4,hist:r", color="black") +
ggmarginal("tr", layer=geomArea(stat=Stat.density(), color="magenta", fill="magenta", alpha=.1)) +
themeMinimal()
residualPlot(iris_dat, "petal_length", "petal_width", colorBy="species")
residualPlot(iris_dat, "petal_length", "petal_width", geom="tile", binWidth=.4 to .1, marginal="none") +
coordFixed(ratio=.25, flip=true) +
theme(axisTicks="blank", axisText="blank", axisLine="blank")
residualPlot(iris_dat, "petal_length", "petal_width", color="white", binWidth=.1, marginal="hist:r") +
ylab("residual") +
themeBW() + theme(text=elementText(family="monospace")) +
flavorHighContrastDark()