toyplot.mark module

class toyplot.mark.AxisLines(coordinate_axes, table, coordinates, stroke, opacity, title, style, annotation)[source]

Bases: toyplot.mark.Mark

Render multiple lines parallel to an axis.

Do not create AxisLines instances directly. Use factory methods such as toyplot.coordinates.Cartesian.hlines() and toyplot.coordinates.Cartesian.vlines() instead.

domain(axis)[source]
class toyplot.mark.BarBoundaries(coordinate_axes, table, left, right, boundaries, fill, opacity, title, style, filename)[source]

Bases: toyplot.mark.Mark

Render multiple stacked bars defined by bar boundaries.

Do not create BarBoundaries instances directly. Use factory methods such as toyplot.bars() or toyplot.coordinates.Cartesian.bars() instead.

domain(axis)[source]
class toyplot.mark.BarMagnitudes(coordinate_axes, table, left, right, baseline, magnitudes, fill, opacity, title, style, filename)[source]

Bases: toyplot.mark.Mark

Render multiple stacked bars defined by bar magnitudes.

Do not create BarMagnitudes instances directly. Use factory methods such as toyplot.bars() or toyplot.coordinates.Cartesian.bars() instead.

domain(axis)[source]
class toyplot.mark.FillBoundaries(coordinate_axes, table, position, boundaries, fill, opacity, title, style, annotation, filename)[source]

Bases: toyplot.mark.Mark

Render multiple stacked fill regions defined by boundaries.

Do not create FillBoundaries instances directly. Use factory methods such as toyplot.fill() or toyplot.coordinates.Cartesian.fill() instead.

domain(axis)[source]
class toyplot.mark.FillMagnitudes(coordinate_axes, table, position, baseline, magnitudes, fill, opacity, title, style, annotation, filename)[source]

Bases: toyplot.mark.Mark

Render multiple stacked fill regions defined by magnitudes.

Do not create FillMagnitudes instances directly. Use factory methods such as toyplot.fill() or toyplot.coordinates.Cartesian.fill() instead.

domain(axis)[source]
class toyplot.mark.Graph(coordinate_axes, vtable, vid, vlabel, vcoordinates, vmarker, vsize, vcolor, vopacity, vtitle, vstyle, vlstyle, vlshow, etable, esource, etarget, eshape, ecoordinates, ecolor, ewidth, eopacity, estyle)[source]

Bases: toyplot.mark.Mark

Plot a graph (collection of vertices and edges).

Do not create Graph instances directly. Use factory methods such as toyplot.coordinates.Cartesian.graph() instead.

domain(axis)[source]
ecoordinates
ecount

Return the number of edges in the graph.

edges

Return the graph edges as a \(E \times 2\) matrix of source, target indices.

eshapes
esources
etargets
vcoordinates

Return the graph vertex coordinates.

vcount

Return the number of vertices in the graph.

vids

Returns the graph vertex identifiers.

class toyplot.mark.Image(xmin_range, xmax_range, ymin_range, ymax_range, data)[source]

Bases: toyplot.mark.Mark

Plot a bitmap image.

Do not create Image instances directly. Use factory methods such as toyplot.image() and toyplot.canvas.Canvas.image() instead.

to_data_url()[source]
to_png()[source]
class toyplot.mark.Legend(xmin, xmax, ymin, ymax, entries, style, lstyle)[source]

Bases: toyplot.mark.Mark

Render a figure legend (a collection of markers and labels).

Do not create Legend instances directly. Use factory methods such as toyplot.canvas.Canvas.legend() or toyplot.coordinates.Cartesian.legend() instead.

class toyplot.mark.Mark(annotation=False)[source]

Bases: object

Base class for all Toyplot marks.

annotation
domain(axis)[source]

Return minimum and maximum domain values for the mark along the given axis.

Parameters:axis (string, required) – Name of an axis along which to return domain values.
Returns:
  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)
extents(axes)[source]

Return range extents for the mark using the given axes.

Parameters:axes (sequence of strings, required) – Specifies the order in which domain coordinates must be returned.
Returns:
  • coordinates (tuple containing arrays of coordinates, in the order specified by the axes parameter.)
  • extents ((left, right, top, bottom) tuple of arrays containing the extents of each datum in range-space, relative to the domain coordinates.)
class toyplot.mark.Plot(coordinate_axes, table, coordinates, series, stroke, stroke_width, stroke_opacity, stroke_title, marker, msize, mfill, mstroke, mopacity, mtitle, style, mstyle, mlstyle, filename)[source]

Bases: toyplot.mark.Mark

Plot multiple bivariate data series using lines and/or markers.

Do not create Plot instances directly. Use factory methods such as toyplot.plot(), toyplot.scatterplot(), toyplot.coordinates.Cartesian.plot() and toyplot.coordinates.Cartesian.scatterplot() instead.

domain(axis)[source]
class toyplot.mark.Rect(coordinate_axes, table, left, right, top, bottom, fill, opacity, title, style, filename)[source]

Bases: toyplot.mark.Mark

Plot axis-aligned rectangles.

Do not create Rect instances directly. Use factory methods such as toyplot.coordinates.Cartesian.rects() instead.

domain(axis)[source]
class toyplot.mark.Scatterplot(coordinate_axes, table, coordinates, marker, msize, mfill, mstroke, mopacity, mtitle, style, mstyle, mlstyle, filename)[source]

Bases: toyplot.mark.Mark

Plot multivariate data series using markers.

Do not create Scatterplot instances directly. Use factory methods such as toyplot.scatterplot() and toyplot.coordinates.Cartesian.scatterplot() instead.

domain(axis)[source]
class toyplot.mark.Text(coordinate_axes, table, coordinates, text, angle, fill, opacity, title, style, annotation, filename)[source]

Bases: toyplot.mark.Mark

Render text.

Do not create Text instances directly. Use factory methods such as toyplot.canvas.Canvas.text() or toyplot.coordinates.Cartesian.text() instead.

domain(axis)[source]
extents(axes)[source]