CoolFace
Apppublic

rackette/MakeTikz

sourceHugging Facemitupdated 10mo agoView on Hugging Face
0likes
App README

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

  1. 1.Enter one or two functions in SymPy syntax, using the variable x. Examples:
  2. 2.x**2 + 3*x - 1
  3. 3.(x+1)/(x-1)
  4. 4.exp(-x**2)
  5. 5.Piecewise((x+1, x < 0), (x-1, True))
  6. 6.log(x) (will be converted to ln in the TikZ code)
  1. 1.Choose the style for each curve
  2. 2.Line style: solid, dashed, dotted, dashdot
  3. 3.Color: black / red / blue / gray / green / orange / purple / brown
  4. 4.Line width (in pt)
  5. 5.LaTeX label (e.g. $f$, $g$)
  1. 1.Adjust the axes
  2. 2.Domain: xmin, xmax, ymin, ymax
  3. 3.Tick steps on x and y
  4. 4.Axis labels x and y
  5. 5.Grid on/off, ticks on/off, tick labels on/off
  6. 6.Advanced options: scale in cm, |y| clipping, number of samples
  1. 1.Click “Générer / Mettre à jour”
  2. 2.The right panel shows a Matplotlib preview of the curves.
  3. 3.The text area below shows the pgfplots/TikZ code ready to paste into a LaTeX document.
  1. 1.Use “📋 Copier le code TikZ”
  2. 2.Copies the generated code to the clipboard.
  3. 3.Paste it inside a LaTeX document with tikz and pgfplots loaded.

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) or Abs(x)
  • Sign: sign(x)
  • Constants: pi, E
  • Piecewise functions:
python
  Piecewise((x+1, x < 0), (x-1, True))