toyplot.mark module

Provides data objects (marks) that are displayed on a canvas.

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]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

class toyplot.mark.BarBoundaries(coordinate_axes, table, left, right, boundaries, fill, opacity, title, hyperlink, 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]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

markers

Return an ordered set of markers used by this mark, if any.

Returns:markers
Return type:list of toyplot.marker.Marker objects.
class toyplot.mark.BarMagnitudes(coordinate_axes, table, left, right, baseline, magnitudes, fill, opacity, title, hyperlink, 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]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

markers

Return an ordered set of markers used by this mark, if any.

Returns:markers
Return type:list of toyplot.marker.Marker objects.
class toyplot.mark.Ellipse(coordinate_axes, table, x, y, rx, ry, angle, fill, opacity, title, style, filename)[source]

Bases: toyplot.mark.Mark

Plot ellipses.

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

domain(axis)[source]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

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]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

markers

Return an ordered set of markers used by this mark, if any.

Returns:markers
Return type:list of toyplot.marker.Marker objects.
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]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

markers

Return an ordered set of markers used by this mark, if any.

Returns:markers
Return type:list of toyplot.marker.Marker objects.
class toyplot.mark.Graph(coordinate_axes, ecolor, ecoordinates, efilename, eopacity, eshape, esource, estyle, etable, etarget, ewidth, hmarker, mmarker, mposition, tmarker, vcolor, vcoordinates, vfilename, vid, vlabel, vlshow, vlstyle, vmarker, vopacity, vsize, vstyle, vtable, vtitle)[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]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

ecoordinates

Warning

attribute ‘toyplot.mark.Graph.ecoordinates’ undocumented

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

Warning

attribute ‘toyplot.mark.Graph.eshapes’ undocumented

esources

Warning

attribute ‘toyplot.mark.Graph.esources’ undocumented

etargets

Warning

attribute ‘toyplot.mark.Graph.etargets’ undocumented

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.

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

Bases: object

Abstract interface for Toyplot marks.

Marks are data objects that are added to a coordinate system for display on a canvas. Marks carry no explicit visual representation of their own - it is up to the coordinate system and rendering backend to determine how to render the data.

For example, a scatterplot mark is rendered using points by a cartesian coordinate system, but could be rendered using lines by a hypothetical parallel coordinate system.

annotation

Warning

attribute ‘toyplot.mark.Mark.annotation’ undocumented

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.)
markers

Return an ordered set of markers used by this mark, if any.

Returns:markers
Return type:list of toyplot.marker.Marker objects.
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]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

markers

Return an ordered set of markers used by this mark, if any.

Returns:markers
Return type:list of toyplot.marker.Marker objects.
class toyplot.mark.Point(coordinate_axes, coordinates, filename, marker, mfill, mhyperlink, mlstyle, mopacity, msize, mstroke, mstyle, mtitle, table)[source]

Bases: toyplot.mark.Mark

Represent one or more data series as points in an arbitrary-dimension space.

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

domain(axis)[source]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

markers

Return an ordered set of markers used by this mark, if any.

Returns:markers
Return type:list of toyplot.marker.Marker objects.
class toyplot.mark.Range(coordinate_axes, coordinates, filename, fill, opacity, style, table, title)[source]

Bases: toyplot.mark.Mark

Represents axis-aligned ranges (min/max pairs) in arbitrary-dimensional space.

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

domain(axis)[source]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
Returns:

  • minimum (minimum domain value along the given axis, or None.)
  • maximum (maximum domain value along the given axis, or None.)

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]

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

Parameters:
  • axis (string, required) –
  • of an axis along which to return domain values. (Name) –
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) –
  • the order in which domain coordinates must be returned. (Specifies) –
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.)