# Parametric curve

> A Lissajous figure, x = sin 3t and y = sin 4t, on equal axes. A pgfplots example with its complete LaTeX source, ready to copy or open in TeXeR.

A pgfplots example in the TeXeR TikZ library: https://texer.org/library/pgfplots/parametric-curve

Package: [pgfplots](https://texer.org/library/pgfplots.md), on CTAN at https://ctan.org/pkg/pgfplots.

Tags: parametric, Lissajous, curve

## Source

```latex
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{tikzpicture}
  \begin{axis}[
    width=7cm, height=7cm, axis equal,
    axis lines=middle, xlabel=$x$, ylabel=$y$,
    xmin=-1.3, xmax=1.3, ymin=-1.3, ymax=1.3,
    xtick={-1,1}, ytick={-1,1},
  ]
    \addplot[blue!70!black, thick, domain=0:360, samples=300, variable=\t]
    ({sin(3*t)}, {sin(4*t)});
  \end{axis}
\end{tikzpicture}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\begin{document}

\begin{tikzpicture}
  \begin{axis}[
    width=7cm, height=7cm, axis equal,
    axis lines=middle, xlabel=$x$, ylabel=$y$,
    xmin=-1.3, xmax=1.3, ymin=-1.3, ymax=1.3,
    xtick={-1,1}, ytick={-1,1},
  ]
    \addplot[blue!70!black, thick, domain=0:360, samples=300, variable=\t]
    ({sin(3*t)}, {sin(4*t)});
  \end{axis}
\end{tikzpicture}
\end{document}
```
