API Reference#

Declarative API Cheat Sheet#

Operator

Showcase

Example

Add a plotter to main canvas.
../_images/api_add_layer.png
wb.add_layer(ColorMesh(data))
Add to the left-side of main canvas.
../_images/api_add_left.png
wb.add_left(Numbers(data),
            size=1, pad=.1,
            name='left-plot')
Add a plotter to the right-side of main canvas.
../_images/api_add_right.png
wb.add_right(Numbers(data))
Add a plotter to the top-side of main canvas.
../_images/api_add_top.png
wb.add_top(Numbers(data))
Add a plotter to the bottom-side of main canvas.
../_images/api_add_bottom.png
wb.add_bottom(Numbers(data))
Add titles to the plot.
../_images/api_add_title.png
wb.add_title(top='Top', bottom='Bottom'
             left='Left', right='Right')
Add a dendrogram to the plot, only available to ClusterBoard.
../_images/api_add_dendrogram.png
cb.add_dendrogram("right")
Split the main canvas vertically by labeling columns, only available to ClusterBoard.
../_images/api_group_cols.png
cb.group_cols(list("11223"))
Split the main canvas horizontally by labeling rows, only available to ClusterBoard.
../_images/api_group_rows.png
cb.group_rows(list("11223"))
Split the main canvas vertically by positions, only available to ClusterBoard.
../_images/api_cut_cols.png
cb.cut_cols([2, 4])
Split the main canvas horizontally by positions, only available to ClusterBoard.
../_images/api_cut_rows.png
cb.cut_rows([2, 4])
Add legends to the plots.
../_images/api_add_legends.png
wb.add_legends()
Add a empty canvas to a chosen side of main plot.
../_images/api_add_canvas.png
wb.add_canvas("right")
Add white space between plot.

wb.add_pad("right", 1)
Add white space surrounding the figure.

wb.set_margin(1)
Render the plot.

wb.render()
Save the plot to a file.

wb.save("output.png", dpi=300)
+
Two canvas side by side, number will be added as white space
../_images/api_concatenate_plus.png
(wb1 + 1 + wb2).render()
/
Two canvas top and bottom, number will be added as white space
../_images/api_concatenate_divide.png
(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 cross-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