Skip to content

ColumnPlotter

A class that contains plotting methods for a column.

Parameters:

Name Type Description Default
column Column<Any> The column to plot. -

Examples:

pipeline example {
    val column = Column("test", [1, 2, 3]);
    val plotter = column.plot;
}
Stub code in ColumnPlotter.sdsstub
class ColumnPlotter(
    column: Column<Any>
) {
    /**
     * Create a box plot for the values in the column. This is only possible for numeric columns.
     *
     * @param theme The color theme of the plot. Default is "light".
     *
     * @result plot The box plot as an image.
     *
     * @example
     * pipeline example {
     *     val column = Column("test", [1, 2, 3]);
     *     val boxplot = column.plot.boxPlot();
     * }
     */
    @Pure
    @PythonName("box_plot")
    fun boxPlot(
        theme: literal<"dark", "light"> = "light"
    ) -> plot: Image

    /**
     * Create a violin plot for the values in the column. This is only possible for numeric columns.
     *
     * @param theme The color theme of the plot. Default is "light".
     *
     * @result plot The violin plot as an image.
     *
     * @example
     * pipeline example {
     *     val column = Column("test", [1, 2, 3]);
     *     val violinplot = column.plot.violinPlot();
     * }
     */
    @Pure
    @PythonName("violin_plot")
    fun violinPlot(
        theme: literal<"dark", "light"> = "light"
    ) -> plot: Image

    /**
     * Create a histogram for the values in the column.
     *
     * @param maxBinCount The maximum number of bins to use in the histogram. Default is 10.
     * @param theme The color theme of the plot. Default is "light".
     *
     * @result plot The plot as an image.
     *
     * @example
     * pipeline example {
     *     val column = Column("test", [1, 2, 3]);
     *     val histogram = column.plot.histogram();
     * }
     */
    @Pure
    fun histogram(
        @PythonName("max_bin_count") const maxBinCount: Int = 10,
        theme: literal<"dark", "light"> = "light"
    ) -> plot: Image where {
        maxBinCount > 0
    }

    /**
     * Create a lag plot for the values in the column.
     *
     * @param lag The amount of lag.
     * @param theme The color theme of the plot. Default is "light".
     *
     * @result plot The plot as an image.
     *
     * @example
     * pipeline example {
     *     val column = Column("values", [1, 2, 3, 4]);
     *     val image = column.plot.lagPlot(2);
     * }
     */
    @Pure
    @PythonName("lag_plot")
    fun lagPlot(
        lag: Int,
        theme: literal<"dark", "light"> = "light"
    ) -> plot: Image
}

boxPlot

Create a box plot for the values in the column. This is only possible for numeric columns.

Parameters:

Name Type Description Default
theme literal<"dark", "light"> The color theme of the plot. Default is "light". "light"

Results:

Name Type Description
plot Image The box plot as an image.

Examples:

pipeline example {
    val column = Column("test", [1, 2, 3]);
    val boxplot = column.plot.boxPlot();
}
Stub code in ColumnPlotter.sdsstub
@Pure
@PythonName("box_plot")
fun boxPlot(
    theme: literal<"dark", "light"> = "light"
) -> plot: Image

histogram

Create a histogram for the values in the column.

Parameters:

Name Type Description Default
maxBinCount Int The maximum number of bins to use in the histogram. Default is 10. 10
theme literal<"dark", "light"> The color theme of the plot. Default is "light". "light"

Results:

Name Type Description
plot Image The plot as an image.

Examples:

pipeline example {
    val column = Column("test", [1, 2, 3]);
    val histogram = column.plot.histogram();
}
Stub code in ColumnPlotter.sdsstub
@Pure
fun histogram(
    @PythonName("max_bin_count") const maxBinCount: Int = 10,
    theme: literal<"dark", "light"> = "light"
) -> plot: Image where {
    maxBinCount > 0
}

lagPlot

Create a lag plot for the values in the column.

Parameters:

Name Type Description Default
lag Int The amount of lag. -
theme literal<"dark", "light"> The color theme of the plot. Default is "light". "light"

Results:

Name Type Description
plot Image The plot as an image.

Examples:

pipeline example {
    val column = Column("values", [1, 2, 3, 4]);
    val image = column.plot.lagPlot(2);
}
Stub code in ColumnPlotter.sdsstub
@Pure
@PythonName("lag_plot")
fun lagPlot(
    lag: Int,
    theme: literal<"dark", "light"> = "light"
) -> plot: Image

violinPlot

Create a violin plot for the values in the column. This is only possible for numeric columns.

Parameters:

Name Type Description Default
theme literal<"dark", "light"> The color theme of the plot. Default is "light". "light"

Results:

Name Type Description
plot Image The violin plot as an image.

Examples:

pipeline example {
    val column = Column("test", [1, 2, 3]);
    val violinplot = column.plot.violinPlot();
}
Stub code in ColumnPlotter.sdsstub
@Pure
@PythonName("violin_plot")
fun violinPlot(
    theme: literal<"dark", "light"> = "light"
) -> plot: Image