class leather.Lattice(shape=None)#

Bases: object

A grid of charts with synchronized shapes, scales, and axes.

Lattice only supports graphing a single series of data.


shape – An instance of Shape to use to render all series. Defaults to Line if not specified.


Set the X Scale for this lattice.


See Lattice.set_x_scale().

add_x_scale(domain_min, domain_max)#

Create and add a Scale.

If the provided domain values are date or datetime then a Temporal scale will be created, otherwise it will Linear.

If you want to set a custom scale class use Lattice.set_x_scale() instead.

add_y_scale(domain_min, domain_max)#

See Lattice.add_x_scale().


Set an Axis class for this lattice.


See Lattice.set_x_axis().

add_x_axis(ticks=None, tick_formatter=None, name=None)#

Create and add an X Axis.

If you want to set a custom axis class use Lattice.set_x_axis() instead.

add_y_axis(ticks=None, tick_formatter=None, name=None)#

See Lattice.add_x_axis().

add_one(data, x=None, y=None, title=None)#

Add a data series to this lattice.

  • data – A sequence of data suitable for constructing a Series, or a sequence of such objects.

  • x – See Series.

  • y – See Series.

  • title – A title to render above this chart.

add_many(data, x=None, y=None, titles=None)#

Same as Lattice.add_one() except data is a list of data series to be added simultaneously.

See Lattice.add_one() for other arguments.

Note that titles is a sequence of titles that must be the same length as data.

to_svg(path=None, width=None, height=None)#

Render the lattice to an SVG.

See Grid for additional documentation.