API reference#
Figure and MultiFigure#
This class implements a general figure object. |
|
This class implements the "canvas" on which multiple plots are displayed. |
This class implements a figure object for plotting |
|
This class implements a figure object for plotting |
|
This class implements a twin axis for the |
Plottables#
This class implements an arrow object. |
|
This class implements a Circle object with a given center and radius. |
|
This class implements contour plots. |
|
This class implements a general continuous curve. |
|
This class implements an Ellipse object with a given center, two radii and an optional rotation angle. |
|
Create a curve fit (continuous |
|
Create a curve fit (continuous |
|
Create a curve fit (continuous |
|
Create a curve fit (continuous |
|
Create a curve fit (continuous |
|
Creates a curve fit (continuous |
|
Create a curve fit (continuous |
|
Create a curve fit (continuous |
|
The class implements heatmaps. |
|
This class implements a general histogram. |
|
This class implements simple horizontal lines. |
|
This class implements a line object. |
|
This experimental class allows to call any matplotlib Axes method as a plottable element in a |
|
This class implements a point object. |
|
This class implements a Polygon object. |
|
This class implements a Rectangle object with a given bottom left corner, width and height. |
|
This class implements a general scatter plot. |
|
This class implements stream plots. |
|
This class allows to plot a table inside a Figure or MultiFigure. |
|
This class allows text to be plotted. |
|
This class implements vector fields. |
|
This class implements simple vertical lines. |
Legend elements#
This class implements a legend line wrapping the Line2D object for creating custom legend entries with the |
|
This class implements a legend marker wrapping the Line2D object with a marker style set for creating custom legend entries with the |
|
This class implements a legend patch wrapping the Patch object for creating custom legend entries with the |
Utility functions#
Returns a color from the specified style (user created, GL, or Matplotlib style). |
|
Returns a list of colors from the specified style (user created, GL, or Matplotlib style). |
|
Returns the default style. |
|
Returns a list or dict of available styles. |
|
Sets the default style. |
Tools#
This class implements the __r* (reverse) and __i* (inplace) methods for adding, subtracting, multiplying, dividing and raising to a power an object that implements the direct methods. |
Errors#
Every exception GraphingLib raises derives from GraphingLibError (also available
under its alias GraphingException), so except graphinglib.GraphingException catches
anything the library raises. Most also derive from the matching built-in exception
(ValueError, TypeError, …), so existing except ValueError / except TypeError
code keeps working too.
- exception graphinglib.GraphingLibError[source]#
Base class for every exception raised by GraphingLib.
Catch this to handle any GraphingLib-specific failure. It is rarely raised directly; prefer one of the specific subclasses below so the failure mode is explicit.
- exception graphinglib.InvalidParameterError[source]#
A public argument has the right type but an unacceptable value.
Use for out-of-range numbers, unrecognised option strings, malformed tuples, and similar (e.g. a negative radius, an unknown line style). Also a
ValueError.
- exception graphinglib.InvalidParameterTypeError[source]#
A public argument has the wrong type.
Use when the value is not an instance of any accepted type (e.g.
num_rowsgiven a string, an unsupported operand incurve + other). Also aTypeError.A wrong value of the correct type (e.g.
num_rowsgiven0) is anInvalidParameterError, not this.
- exception graphinglib.IncompatibleArgumentsError[source]#
Several arguments are individually valid but conflict with one another.
Use for mutually exclusive options set together, co-required options where only one is given, or length mismatches between related sequences (e.g. tick positions and tick labels of different lengths). Also a
ValueError.
- exception graphinglib.InvalidOperationError[source]#
The operation is not allowed for the object’s current state or configuration.
Use when the arguments are fine but the object cannot honour the call as it stands (e.g. plotting a figure with no elements, adding a twin axis that already exists). Also a
RuntimeError.
- exception graphinglib.LayoutError[source]#
A
SmartFiguregrid/geometry constraint is violated.A specialised
InvalidOperationErrorfor layout problems: overlapping spans, children that do not fit the target grid, indexing a leaf as if it were a layout, etc.
- exception graphinglib.StyleNotFoundError[source]#
A named style (or similar resource) could not be found.
Use when a requested
figure_styledoes not exist among the built-in or user styles. Also aLookupError.
- exception graphinglib.StyleFileError[source]#
A style file could not be read, parsed, or automatically updated.
An integrity error about GraphingLib’s own configuration data rather than user input; this is the one place where directing the user to report the problem is appropriate.
- exception graphinglib.MissingOptionalDependencyError[source]#
A feature requires an optional dependency that is not installed.
Use when a feature gated behind a
graphinglib[extra]is invoked without the extra. The message should name the extra and how to install it. Also anImportError.
- exception graphinglib.UnsupportedFeatureError[source]#
A requested capability is deliberately not available.
Use for things GraphingLib knowingly does not support (e.g. a 3D projection, or a WCS-only feature used on a non-WCS figure). Also a
NotImplementedError.
- exception graphinglib.PlottingError[source]#
A matplotlib, scipy, or numpy call failed while building or rendering an element.
Use to wrap a lower-level exception raised deep inside a dependency (a failed plot call, a fit that did not converge, an interpolation error, …) so the user sees GraphingLib context instead of a bare backend error. Always chain the original with
raise PlottingError(...) from exc. Also aRuntimeError.