rackette/MakeTikz
0
MakeTikZ – LaTeX graph generator (pgfplots/TikZ)
MakeTikZ is a small web tool to generate pgfplots/TikZ code from SymPy functions, with a live Matplotlib preview. It is designed for teachers and students who want clean LaTeX plots (courses, exams, worksheets) without hand-writing \addplot commands.
How it works
- Enter one or two functions in SymPy syntax, using the variable
x. Examples: x**2 + 3*x - 1(x+1)/(x-1)exp(-x**2)Piecewise((x+1, x < 0), (x-1, True))log(x)(will be converted tolnin the TikZ code)
- Choose the style for each curve
- Line style:
solid,dashed,dotted,dashdot - Color: black / red / blue / gray / green / orange / purple / brown
- Line width (in pt)
- LaTeX label (e.g.
$f$,$g$)
- Adjust the axes
- Domain:
xmin,xmax,ymin,ymax - Tick steps on x and y
- Axis labels
xandy - Grid on/off, ticks on/off, tick labels on/off
- Advanced options: scale in cm,
|y|clipping, number of samples
- Click “Générer / Mettre à jour”
- The right panel shows a Matplotlib preview of the curves.
- The text area below shows the pgfplots/TikZ code ready to paste into a LaTeX document.
- Use “📋 Copier le code TikZ”
- Copies the generated code to the clipboard.
- Paste it inside a LaTeX document with
tikzandpgfplotsloaded.
Supported syntax (SymPy)
- Variable:
x - Basic operators:
+,-,*,/,**(or^) - Polynomials:
x**2 + 3*x - 2 - Rational functions:
(x+1)/(x-1)(vertical asymptotes handled) - Trigonometric:
sin(x),cos(x),tan(x) - Hyperbolic:
sinh(x),cosh(x),tanh(x) - Exponential / log:
exp(x),log(x)(natural log),log10(x) - Absolute value:
abs(x)orAbs(x) - Sign:
sign(x) - Constants:
pi,E - Piecewise functions:
Piecewise((x+1, x < 0), (x-1, True))