Skip to content

Getting Started

Installation

Install cplots with your preferred backend:

pip install cplots[matplotlib]

Available extras: matplotlib, plotly, altair, getdist.

Your first plot

Switching backends

plot.show(backend="plotly")
plot.save("out.html", backend="plotly")
with cplots.backend("altair"):
    plot.show()
cplots.set_backend("plotly")
plot.show()  # always uses plotly

Saving a figure

plot.save("figure.png")                     # PNG via matplotlib
plot.save("figure.html", backend="plotly")  # interactive HTML

Applying a theme

Built-in themes: cplots.PUBLICATION (serif, white background) and cplots.DARK (transparent, neon palette).

Multi-panel figures

See Multi-panel Figures for full documentation.