![このようなタイプのプロット(尾根線)を作成することは可能ですか?](https://rvso.com/image/461872/%E3%81%93%E3%81%AE%E3%82%88%E3%81%86%E3%81%AA%E3%82%BF%E3%82%A4%E3%83%97%E3%81%AE%E3%83%97%E3%83%AD%E3%83%83%E3%83%88%EF%BC%88%E5%B0%BE%E6%A0%B9%E7%B7%9A%EF%BC%89%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AF%E5%8F%AF%E8%83%BD%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
答え1
複数のプロットを y 軸上に積み重ねるには、 オプション を使用できますstack plots = y
。ただし、同じ数のデータで構成されたグラフのみを受け入れるという制限があります。回答のベースとなるデータセットを提供していただければ、より適切な回答を提供できます。
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{xcolor}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{every axis plot post/.append style={draw=black, fill=gray!25}}
\begin{axis}[
smooth,
stack plots=y,
area style,
enlarge x limits=false,
xlabel=length (minutes),
ylabel=year,]
\addplot coordinates {(0,1) (1,1.5) (2,2) (3,2) (4,1.5) (5,1)} ;
\addplot coordinates {(0,1) (1,1) (2,2) (3,2) (4,1) (5,1)} ;
\addplot coordinates {(0,0.5) (0.5,1) (1,1.5) (1.5,1) (2,0)} ;
\end{axis}
\end{tikzpicture}
\end{document}