On X (Twitter), I saw a post by @clcoding demonstrating making area charts in Python. As I knew that we can do them easily with pgfplots, I did the same. We can use the ‘fillbetween’ library as follows:

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[
    trig format plots = rad,
    samples     = 60,
    domain      = 0:10,
    no markers, smooth]
  \addplot[name path=f1, black, thick] {sin(x)};
  \addplot[name path=f2, gray,  thick] {sin(x)+1};
  \addplot fill between[ of = f1 and f2, 
    every even segment/.style = {orange!60}];
  \addplot[name path=zero, gray, line width=1pt] {0};
  \addplot fill between[ of = f1 and zero, split,
    every even segment/.style = {orange!90!black},
    every odd segment/.style  = {blue!30}];
\end{axis}
\end{tikzpicture}
\end{document}

See also: Original Source by Stefan Kottwitz

Note: The copyright belongs to the blog author and the blog. For the license, please see the linked original source blog.