Skip to content

Instantly share code, notes, and snippets.

@dfbarrero
Last active May 12, 2017 18:33
Show Gist options
  • Select an option

  • Save dfbarrero/bd789f82b6aec2960da843f2f7988617 to your computer and use it in GitHub Desktop.

Select an option

Save dfbarrero/bd789f82b6aec2960da843f2f7988617 to your computer and use it in GitHub Desktop.
Example of two overlapped plots in LaTeX/Tikz.
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel=$y$,
domain=-2:4
]
\addplot[color=red] {sin(deg(x))};
\addplot[color=blue] {cos(deg(x)};
\legend{$\sin(x)$,$\cos(x)$}
\end{axis}
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment