答案1
pgfplots
和库的一个简单示例fillbetween
:
\documentclass[border=5mm]{standalone}
\usepackage{filecontents}
\begin{filecontents*}{data.dat}
x y err
0 1 0.1
1 1.5 0.3
2 2 0.2
\end{filecontents*}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot table[x=x,y=y] {data.dat};
\addplot [name path=upper,draw=none] table[x=x,y expr=\thisrow{y}+\thisrow{err}] {data.dat};
\addplot [name path=lower,draw=none] table[x=x,y expr=\thisrow{y}-\thisrow{err}] {data.dat};
\addplot [fill=blue!10] fill between[of=upper and lower];
\end{axis}
\end{tikzpicture}
\end{document}