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.33.tar.gz (5.5 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.33-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for plotmath-0.2.33.tar.gz
Algorithm Hash digest
SHA256 391af877170690a50f88440ac2059f2eea06530011948976606f9065d602a6cb
MD5 4dc196ad333d7817c6cee6317e11b4a8
BLAKE2b-256 a230119d10afa4a32ee42a999397cc8676ba8912a046226e3803722b1ffa7a65

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for plotmath-0.2.33-py3-none-any.whl
Algorithm Hash digest
SHA256 05e20db7c0982734b94689b25bd3910f4eb60103ff82b73a99268077bf4bdcfd
MD5 8174966335cf3a37b28e36285320679a
BLAKE2b-256 7ded44cf3fc6eb88e781f0cab2bee00cd76585c6959906c94d44bfe2ce7e65f6

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