mathsvg
A Python library to draw mathematical objects. Create figures and diagrams and save them as SVG files.
The complete documentation is available at: https://mathsvg.readthedocs.io. The sources are hosted on GitHub: https://github.com/alexn11/mathsvg.
Programs such as Inkscape are great for creating vector graphics. But Inkscape is made more for designer rather than for mathematicians. The process of doing mathematical diagrams and illustrations using Inkscape can sometimes be quite frustrating. Making a python script to produce the content of an SVG file can be a faster solution.
The role of mathsvg is to help with the process of producing your own SVG diagrams using Python scripts. For that purpose a class SvgImage is defined which contains many usefull routines that simplify the creation of mathematical figures with precise descriptions.
Once the mathsvg package and all its dependencies are installed it can be used as a normal Python package.
Here is an example for the creation of a very simple image:
import mathsvg
image = mathsvg.SvgImage(pixel_density = 100, view_window = (( -1, -1 ), ( 1, 1 )))
image.draw_circle([0, 0], 1.1)
image.save("simple-example.svg")
The above program does the following.
After importing the package mathsvg, a SvgImage object is created. The parameters of the constructors are the pixel density (number of pixel per unit of length) and the view window which selects the part of the plane that will be rendered in the image. The coordinates of mathematical objects will be automatically be converted into coordinates on the SVG canvas.
A circle with center (0, 0) and radius 1.1 is drawn using the default drawing options (black solid stroke). Some points of the circle won't appear in the image since they are outside the canvas.
Finally the image is saved in a file with the name "simple-example.svg".
Metadata
Release files for mathsvg 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mathsvg-0.4.0.tar.gz | 15.9 kB | Without provenance | Details for mathsvg-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mathsvg-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for mathsvg-0.4.0-py3-none-any.whl |
Total release size: 33.5 kB
Release files / mathsvg-0.4.0.tar.gz
| Download URL | mathsvg-0.4.0.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
deb709f32b72c1f73d8e843ffedd54b1948713fffbe76b3a138bd9a407d3f1ec
|
|
BLAKE2b-256 checksum How to use checksums |
e169090988c595f4753fada9710c981d94e32f226b4fd212b60b7cf6e2700690
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.5
|
Release files / mathsvg-0.4.0-py3-none-any.whl
| Download URL | mathsvg-0.4.0-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4cfc104c8928c2371cc003df315ec08cb0e0766911a8cd1d87c938f9af5a178
|
|
BLAKE2b-256 checksum How to use checksums |
8177bec8948ad1bdca34ef648158cae9e894ea8941c053d809931174faf09482
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.5
|
Security for mathsvg 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.