Automatically generates textbook graphs for mathematical functions.
Project description
mathplot
mathplot 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.make_figure(
functions=[f],
)
plotmath.savefig(
dirname="../figures",
fname="example_1.svg",
)
plotmath.show()
This will generate the following figure:
Example 2
import plotmath
import numpy as np
def f(x):
return x**2 * np.cos(x)
fix, ax = plotmath.make_figure(
functions=[f],
xmin=-6,
xmax=6,
ymin=-12,
ymax=8,
)
plotmath.savefig(
dirname="../figures",
fname="example_2.svg",
)
plotmath.show()
This will generate the following figure:
Example 3
import plotmath
def f(x):
return x**2 - 4
def g(x):
return x + 2
fix, ax = plotmath.make_figure(
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:
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.1.8.tar.gz
(4.0 kB
view hashes)