sagemath_plot: Plotting and graphics with Matplotlib, Three.JS, etc.¶
This pip-installable distribution passagemath-plot
is a distribution of a part of the Sage Library.
It provides the namespace packages sage.plot
and sage.plot.plot3d
, which provide functions for plotting that are very similar to Mathematica’s plotting functions. This is analogous to how matplotlib’s pyplot
package provides a UI on top of the core matplotlib
library that is similar to matlab’s plotting UI.
What is included¶
Backend for 2D graphics: matplotlib
Backend for 3D graphics: three.js
Examples¶
$ pipx run --pip-args="--prefer-binary" --spec "passagemath-plot[test]" ipython
In [1]: from sage.all__sagemath_plot import *
In [2]: scatter_plot([[0,1],[2,2],[4.3,1.1]], marker='s').save('output.png')
In [3]: G = tetrahedron((0,-3.5,0), color='blue') + cube((0,-2,0), color=(.25,0,.5))
In [4]: G.show(aspect_ratio=[1,1,1])
Graphics3d Object
Available as extras, from other distributions¶
pip install "passagemath-plot[dot2tex]"
Transforming Graphviz files: dot2tex
pip install "passagemath-plot[graphs]"
Graphs and networks: sagemath-graphs
pip install "passagemath-plot[jsmol]"
Alternative backend for 3D graphics: jupyter-jsmol
pip install "passagemath-plot[playwright]"
Screenshotting tool for saving 3D graphics as 2D image files: playwright
pip install "passagemath-plot[polyhedra]"
Polyhedra in arbitrary dimension, plotting in dimensions 2, 3, 4: passagemath-polyhedra
pip install "passagemath-plot[symbolics]"
Defining and plotting symbolic functions and manifolds: passagemath-symbolics
pip install "passagemath-plot[tachyon]"
Ray tracing system, needed for saving 3D graphics as 2D image files: passagemath-tachyon
Type¶
standard
Dependencies¶
$(PYTHON)
$(PYTHON_TOOLCHAIN)
cython: C-Extensions for Python, an optimizing static compiler
memory_allocator: An extension class to allocate memory easily with Cython
mpc: Arithmetic of complex numbers with arbitrarily high precision and correct rounding
mpfr: Multiple-precision floating-point computations with correct rounding
sagemath_categories: Sage categories, basic rings, polynomials, functions
Version Information¶
package-version.txt:
10.6.29
version_requirements.txt:
passagemath-plot ~= 10.6.29.0
Installation commands¶
$ pip install passagemath-plot~=10.6.29.0
$ sage -i sagemath_plot
However, these system packages will not be used for building Sage
because spkg-configure.m4
has not been written for this package;
see upstream Issue #27330 for more information.