sc_plotting#

Extensions to Matplotlib, including 3D plotting and plot customization.

Highlights:
  • sc.plot3d(): easy way to render 3D plots

  • sc.boxoff(): turn off top and right parts of the axes box

  • sc.commaticks(): convert labels from “10000” and “1e6” to “10,000” and “1,000,0000”

  • sc.SIticks(): convert labels from “10000” and “1e6” to “10k” and “1m”

  • sc.maximize(): make the figure fill the whole screen

  • sc.savemovie(): save a sequence of figures as an MP4 or other movie

  • sc.fonts(): list available fonts or add new ones

Classes

ScirisDateFormatter

An adaptation of Matplotlib's ConciseDateFormatter with a slightly different approach to formatting dates.

animation

A class for storing and saving a Matplotlib animation.

Functions

fig3d

Shortcut for creating a figure with 3D axes.

ax3d

Create a 3D axis to plot in.

plot3d

Plot 3D data as a line

scatter3d

Plot 3D data as a scatter

surf3d

Plot 2D or 3D data as a 3D surface

bar3d

Plot 2D data as 3D bars

stackedbar

Create a stacked bar chart.

boxoff

Removes the top and right borders ("spines") of a plot.

setaxislim

A small script to determine how the y limits should be set. Looks at all data (a list of arrays) and computes the lower limit to use, e.g.::.

setxlim

Alias for sc.setaxislim(which='x')

setylim

Alias for sc.setaxislim(which='y').

commaticks

Use commas in formatting the y axis of a figure (e.g., 34,000 instead of 34000).

SIticks

Apply SI tick formatting to one axis of a figure (e.g., 34k instead of 34000)

getrowscols

Get the number of rows and columns needed to plot N figures.

get_rows_cols

Get the number of rows and columns needed to plot N figures.

figlayout

Alias to both fig.set_layout_engine() and fig.subplots_adjust().

maximize

Maximize the current (or supplied) figure.

fonts

List available fonts, or add new ones.

dateformatter

Format the x-axis to use a given date formatter.

datenumformatter

Format a numeric x-axis to use dates.

savefig

Save a figure, including metadata

savefigs

Save the requested plots to disk.

loadfig

Load a plot from a file and reanimate it.

emptyfig

The emptiest figure possible

separatelegend

Allows the legend of a figure to be rendered in a separate window instead

orderlegend

Create a legend with a specified order, or change the order of an existing legend.

savemovie

Save a set of Matplotlib artists as a movie.