Skip to main content

Automatically generates textbook graphs for mathematical functions.

Project description

plotmath

plotmath is a Python package to automatically create textbook graphs of mathematical functions.

Basic examples

Example 1

import plotmath


def f(x):
    return x**2 - x - 2


fix, ax = plotmath.plot(
    functions=[f],
)

plotmath.savefig(
    dirname="../figures",
    fname="example_1.svg",
)

plotmath.show()

This will generate the following figure:

figure 1

Example 2

import plotmath
import numpy as np


def f(x):
    return x**2 * np.cos(x)


fix, ax = plotmath.plot(
    functions=[f],
    xmin=-6,
    xmax=6,
    ymin=-12,
    ymax=12,
    xstep=1,
    ystep=2,
)

plotmath.savefig(
    dirname="../figures",
    fname="example_2.svg",
)

plotmath.show()

This will generate the following figure:

figure 2

Example 3

import plotmath


def f(x):
    return x**2 - 4


def g(x):
    return x + 2


fix, ax = plotmath.plot(
    functions=[f, g],
    xmin=-6,
    xmax=6,
    ymin=-6,
    ymax=6,
)

plotmath.savefig(
    dirname="../figures",
    fname="example_3.svg",
)

plotmath.show()

This will generate the following figure:

figure 3

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotmath-0.2.28.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotmath-0.2.28-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file plotmath-0.2.28.tar.gz.

File metadata

  • Download URL: plotmath-0.2.28.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for plotmath-0.2.28.tar.gz
Algorithm Hash digest
SHA256 9569544bdef507a5db3a265932d814fccdf663f6328336cf9e51035ad0a1686f
MD5 42e98b7666e5a210c30d7c23f6041053
BLAKE2b-256 63a407ca671316b98e741805b860088d7a19b90d380b9ae10517778dda01d402

See more details on using hashes here.

File details

Details for the file plotmath-0.2.28-py3-none-any.whl.

File metadata

  • Download URL: plotmath-0.2.28-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for plotmath-0.2.28-py3-none-any.whl
Algorithm Hash digest
SHA256 ef03fe24fa7569638c8d91b627c31fb3167266e38a2ffe981b6ed97b6d03879f
MD5 40ddf13fef4ede9333d03e3812a1eaa2
BLAKE2b-256 36c1df7f1d14422c2778e843207e5fb78d47425a82eb4d9742865683a05d5d3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page