Skip to content

Instantly share code, notes, and snippets.

@pkofod
Created May 26, 2016 18:23
Show Gist options
  • Save pkofod/8e4bb3252c2c38a0b6f574f2aaf2d992 to your computer and use it in GitHub Desktop.
Save pkofod/8e4bb3252c2c38a0b6f574f2aaf2d992 to your computer and use it in GitHub Desktop.
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\usepgfplotslibrary{fillbetween}
\begin{tikzpicture}
\begin{axis}
\addplot[name path=function, domain=-1.5:1] {x^2};
\path[name path=axis] (axis cs:-1.5,0.0) -- (axis cs:1,0.0);
\addplot[yellow] fill between[of = function and axis];
\end{axis}
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment