API Reference#

Declarative API Cheat Sheet#

Operator

Description

Example

add_layer()

Add a plotter to main canvas.

wb.add_layer(ColorMesh(data))

add_left()

Add to the left-side of main canvas.

wb.add_left(Numbers(data),
            size=1, pad=.1,
            name='left-plot')

add_right()

Add a plotter to the right-side of main canvas.

wb.add_right(Numbers(data))

add_top()

Add a plotter to the top-side of main canvas.

wb.add_top(Numbers(data))

add_bottom()

Add a plotter to the bottom-side of main canvas.

wb.add_bottom(Numbers(data))

add_title()

Add titles to the plot.

wb.add_title(top='Top Title', bottom='Bottom Title'
             left='Left Title', right='Right Title')

add_dendrogram()

Add a dendrogram to the plot, only available to ClusterBoard.

cb.add_dendrogram("left", data)

group_cols()

Split the main canvas horizontally, only available to ClusterBoard.

cb.group_cols(labels=[1, 1, 2, 2], order=[2, 1])

group_rows()

Split the main canvas vertically, only available to ClusterBoard.

cb.group_rows(labels=[1, 1, 2, 2], order=[2, 1])

cut_cols()

Split the main canvas horizontally, only available to ClusterBoard.

cb.cut_cols([5])

cut_rows()

Split the main canvas vertically, only available to ClusterBoard.

cb.cut_rows([5])

add_legends()

Add legends to the plots.

wb.add_legends()

add_canvas()

Add a plotter to a chosen side of main plot.

wb.add_canvas("right", Numbers(data))

add_pad()

Add white space between plot.

wb.add_pad("right", 1)

set_margin()

Add white space surrounding the figure.

wb.set_margin(1)

render()

Render the plot.

wb.render()

save()

Save the plot to a file.

wb.save("output.png", dpi=300)

+

Two canvas side by side, number will be added as white space

(wb1 + 1 + wb2).render()

/

Two canvas top and bottom, number will be added as white space

(wb1 / 1 / wb2).render()

High-Level Visualizations#

Heatmap Variants#

Heatmap

See ColorMesh for details

SizedHeatmap

Sized Heatmap

CatHeatmap

Categorical Heatmap

Layers Heatmap#

Layers

LayersMesh

The mesh that draw customized elements in multi-layers

UpSet plots#

Upset

Upset Plot

UpsetData

Handle multiple sets

OncoPrint#

OncoPrint

OncoPrint plot

Plotters#

Mesh#

ColorMesh

Continuous Heatmap

Colors

Categorical colors/heatmap

SizedMesh

Mesh for sized elements

MarkerMesh

The mesh that draw marker shape

TextMesh

The mesh that draw text on each cell

Seaborn plots#

Bar

Wrapper for seaborn's barplot

Box

Wrapper for seaborn's boxplot

Boxen

Wrapper for seaborn's boxenplot

Violin

Wrapper for seaborn's violinplot

Point

Wrapper for seaborn's pointplot

Strip

Wrapper for seaborn's stripplot

Swarm

Wrapper for seaborn's swarmplot

Other plots#

Area

Area plot

Arc

Arc diagram.

Numbers

Show numbers in bar plot

StackBar

Stacked Bar

CenterBar

Two comparable bar plots with center line

SeqLogo

Sequence logo

Image

Plot static images

Emoji

Have fun with emoji images

Range

Range plot

Text Label#

Labels

Add text labels

AnnoLabels

Annotate a few rows or columns

Title

Add a title

Chunk

Mark groups

FixedChunk

Mark groups with fixed order

Main Canvas#

WhiteBoard

The base class that handle all rendering process

ClusterBoard

A main canvas class that can handle cluster data

LegendMaker

The factory class to handle legends

ZeroWidth

A utility class to initialize a canvas with zero width

ZeroHeight

A utility class to initialize a canvas with zero height

ZeroWidthCluster

A utility class to initialize a canvas with zero width and cluster data

ZeroHeightCluster

A utility class to initialize a canvas with zero height and cluster data

Layout Engine#

CrossLayout

The X-layout engine

CompositeCrossLayout

A class to layout multiple Cross Layouts

Data Manipulation#

Deformation

A helper class to handle data

Render plan#

RenderPlan

The base class for every plotter in Marsilea

RenderSpec

The container class that holds the rendering data and parameters for each axes

Datasets#

load_data

To load marsilea dataset