是否可以仅显示蓝色函数中严格大于红色函数的部分?
\begin{tikzpicture}
[/pgf/declare function={ f=2; g=1.4*(x-2); h=.1*x*x+.2*x+.5;}]
\begin{axis}[axis lines=left,domain=-1:20, samples=100,xmin=0, xmax=10, ymin=0, ymax=10,no markers, unit vector ratio*=1 1 1, xtick=\empty, ytick=\empty, ]
\addplot [line width=.5pt, blue] {h};
\addplot [line width=.5pt, red] {max(f,g)};
\end{axis}
\end{tikzpicture}
我尝试使用 max 函数,但在第一部分我得到了一种奇怪的紫色
\begin{tikzpicture}
[/pgf/declare function={ f=2; g=1.4*(x-2); h=.1*x*x+.2*x+.5;}]
\begin{axis}[axis lines=left,domain=-1:20, samples=100, xmin=0, xmax=10, ymin=0, ymax=10, no markers, unit vector ratio*=1 1 1, xtick=\empty, ytick=\empty, ]
\addplot [line width=.5pt, blue] {max(f,g,h)};
\addplot [line width=.5pt, red] {max(f,g)};
\end{axis}
\end{tikzpicture}
这就是我现在所拥有的