我正在尝试填充给定曲线下方的区域。编译 pdflatex 时提示未使用正确的 usepgfplotlibrary。请参阅代码。
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{tikzpicture}
\begin{axis}[enlargelimits=0.1]
\addplot[name path=f,domain=-.15:1.05,blue] {x^2};
\path[name path=axis] (axis cs:0,0) -- (axis cs:1,0);
\addplot [
thick,
color=blue,
fill=blue,
fill opacity=0.05
]
fill between[
of=f and axis,
soft clip={domain=0:1},
];
\node [rotate=48] at (axis cs: .7, .59) {$y=x^2$};
\node [rotate=90] at (axis cs: 1.05, .25) {$x=1$};
\end{axis}
\end{tikzpicture}
\end{document}
错误
! Package pgfplots Error: Please load \usepgfplotslibrary{fillbetween} in order
to use `\addplot fill between'..
See the pgfplots package documentation for explanation.
Type H <return> for immediate help.
...
l.25 ];