6  Visualization

import rtemis as rt
▄▄▄  ▄▄▄▄▄▄▄▄ .• ▌ ▄ ·. ▪  .▄▄ ·
▀▄ █·•██  ▀▄.▀··██ ▐███▪██ ▐█ ▀.
▐▀▀▄  ▐█.▪▐▀▀▪▄▐█ ▌▐▌▐█·▐█·▄▀▀▀█▄
▐█•█▌ ▐█▌·▐█▄▄▌██ ██▌▐█▌▐█▌▐█▄▪▐█
.▀  ▀ ▀▀▀  ▀▀▀ ▀▀  █▪▀▀▀▀▀▀ ▀▀▀▀ py
.:rtemispy v.0.2.1 🏝 macOS-13.4.1-arm64-arm-64bit

Load iris dataset from disk

iris = rt.read("~/Data/iris.csv")
06-25-23 14:51:32 ▶ Reading iris.csv... :read
06-25-23 14:51:33 Got 149 rows & 5 columns :read
06-25-23 14:51:33 Read in 0.00869 seconds :read

6.1 Boxplot

rt.dplot3_box(iris[:, "sepal_length"])

For smaller datasets, it is often useful to show the individual data points using boxpoints="all".

rt.dplot3_box(
    iris[:, "sepal_length"],
    boxpoints="all")

Visualize multiple variables:

rt.dplot3_box(
    iris[:, 0:4],
    boxpoints="all")

6.2 Histogram

rt.dplot3_x(iris[:, "sepal_length"])
rt.dplot3_x(iris[:, "sepal_length"], hist_nbins=24)

6.3 Scatter

rt.dplot3_xy(
    iris["sepal_length"],
    iris["petal_length"])

Add a regression line:

rt.dplot3_xy(
    iris["sepal_length"],
    iris["petal_length"],
    xlab = "Sepal Length",
    ylab = "Petal Length",
    fit="glm")

Group by a categorical variable:

rt.dplot3_xy(
    iris["sepal_length"],
    iris["petal_length"],
    group=iris["species"],
    xlab = "Sepal Length",
    ylab = "Petal Length")

Fits are automatically applied by group:

rt.dplot3_xy(
    iris["sepal_length"],
    iris["petal_length"],
    group=iris["species"],
    fit="glm",
    xlab = "Sepal Length",
    ylab = "Petal Length")