packages

plot

Scientific plotting to SVG, PNG and the terminal, in pure Nabi.

Modules

  • axes The Axes builder: one plot area with its layers, axes, labels and legend.
  • calendar Dates on an axis: values are seconds since 1970-01-01 00:00 UTC (proleptic Gregorian calendar, no leap seconds).
  • color sRGB colours with alpha, CSS-style parsing, and the colour cycles a theme draws series colours from.
  • colormap Colormaps: 256-entry lookup tables, as matplotlib builds them, from the published data (tables.nabi) or from control colours.
  • contour Contours of a grid, by marching triangles: each cell splits along one diagonal into two triangles over which the data is linear, so no saddle is ambiguous.
  • data Input data.
  • error The one error type of the package.
  • figure Figures: a layout tree of Axes (rows and columns, nested), a size, a theme and a title, rendered to SVG, PNG or the terminal.
  • font The built-in font: Geist Regular, with Greek and some mathematical symbols from Pretendard, as outlines in font units (glyphs.nabi, generated by tools/font.py).
  • format Tick label formatters.
  • frame Plotting the columns of a table::Table by name, with the table feature.
  • layer What an Axes holds: layers, each one mark (a line, markers, bars, an image, ...) with its style.
  • ops Operators.
  • path Vector paths in pixel coordinates (y down): moves, lines, quadratic and cubic Beziers, and closes.
  • png PNG encoding (ISO/IEC 15948): 8-bit RGB, or RGBA when any pixel is not opaque, each row filtered by the type with the smallest sum of absolute values (the usual heuristic), compressed by the package's own DEFLATE.
  • quick One-call plots: each function starts an Axes with one layer, so it chains (plot::line(x, y).label("a").scatter(x, z)), adds (a + b overlays), lays out (a | b, a / b) and pipes (y |> plot::hist() |> plot::svg()).
  • raster The rasterizer behind PNG output.
  • scale Axis scales: the map from data values to a linear screen coordinate.
  • scene A rendered figure as drawing primitives in px (y down), the one input of every backend.
  • stat The statistics a few plot types draw: histogram bins (NumPy's rules), box plot quartiles (linear interpolation, NumPy's default) and Gaussian kernel density estimates (Scott's bandwidth) for violins.
  • svg The SVG backend.
  • term The terminal backend: a quick look in the REPL.
  • text Label text with a TeX-like math subset.
  • theme Themes: colours, sizes and the colour cycle.
  • ticks Tick locators.

Re-exports

axes::{Axes, axes}Source

pub use axes::{Axes, axes}
  • Axes A plot area: layers drawn against an x axis and a left (and maybe a right) y axis, with a title, a legend and a colorbar.
  • axes An empty Axes.

calendar::{date, datetime}Source

pub use calendar::{date, datetime}
  • date Seconds since the epoch at the start of a date.
  • datetime Seconds since the epoch at a date and time of day (UTC).

color::{Color, ColorSpec}Source

pub use color::{Color, ColorSpec}
  • Color An sRGB colour with alpha, 8 bits a channel.
  • ColorSpec What a builder takes for a colour: a Color, a string that Color::parse reads or "C0" to "C9" (the theme's cycle), or none for the next colour of the cycle.

colormap::ColormapSource

pub use colormap::Colormap
  • Colormap A map from [0, 1] to colours: 256 entries, looked up as matplotlib does (v in [k / 256, (k + 1) / 256) gives entry k).

data::{Data, Grid}Source

pub use data::{Data, Grid}
  • Data A series of numbers to plot.
  • Grid A 2-d grid of values for heatmap and contour: row i is the i-th y position, from the bottom of the plot unless the layer says otherwise.

error::PlotErrorSource

pub use error::PlotError
  • PlotError What went wrong while rendering or saving a figure.

figure::FigureSource

pub use figure::Figure
  • Figure A figure: panels laid out in rows and columns, rendered as one image.

format::FormatSource

pub use format::Format
  • Format How tick values become labels.

layer::{Dash, Loc, Marker, StepAt}Source

pub use layer::{Dash, Loc, Marker, StepAt}
  • Dash A line's dash pattern.
  • Loc Where the legend goes.
  • Marker A marker shape.
  • StepAt Where a step plot changes value: at x[i] going right (Post, the value holds until the next point), before it (Pre), or halfway (Mid).

path::PathSource

pub use path::Path

quick::{Plottable, area, bar, boxplot, contour, contourf, errorbar, fill_between, heatmap, hist, imshow, line, linspace, png, quiver, save, scatter, show, step, svg, violin}Source

pub use quick::{Plottable, area, bar, boxplot, contour, contourf, errorbar, fill_between, heatmap, hist, imshow, line, linspace, png, quiver, save, scatter, show, step, svg, violin}
  • Plottable A figure or an Axes: what svg, png, save and show take.
  • area An area under a curve.
  • bar A bar chart over categories.
  • boxplot Box plots of groups.
  • contour Contour lines of a grid.
  • contourf Filled contours of a grid.
  • errorbar Points with symmetric error bars.
  • fill_between The region between two curves.
  • heatmap A heatmap of a grid, row 0 at the bottom.
  • hist A histogram.
  • imshow An image of a grid, row 0 at the top, square pixels.
  • line A line plot.
  • linspace
  • png The PNG of a figure or an Axes.
  • quiver A vector field.
  • save Writes a figure or an Axes to an .svg or .png file.
  • scatter A scatter plot.
  • show Prints a figure or an Axes to the terminal.
  • step A step plot.
  • svg The SVG of a figure or an Axes.
  • violin Violin plots of groups.

scale::ScaleSource

pub use scale::Scale
  • Scale How an axis maps values to positions.

stat::BinsSource

pub use stat::Bins
  • Bins How a histogram picks its bins.

theme::ThemeSource

pub use theme::Theme
  • Theme How a figure looks: colours, type sizes, line widths, the series colour cycle and the default colormap.