答案1
你可以玩和in
。out
为了获得平滑的曲线,你只需确保两个连续点的in
和out
参数相差 180 度。使用松散度,你可以进一步控制曲线的形状。
\documentclass[tikz,border=3.14pt]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[gray] (-1,-3) grid (9,4);
\draw[thick,-latex] (-1,0) -- (9,0) node[below left]{$x$};
\draw[thick,-latex] (0,-3) -- (0,4) node[below right]{$y$};
\draw[thick,blue] (0,0) to[out=-70,in=180] (1.2,-1.5)
to [out=0,in=180,looseness=0.4] (5.8,3.9) to[out=0,in=120,looseness=0.5] (8,0);
\node[anchor=north west] at (5,0) {5};
\node[anchor=north east] at (0,0) {0};
\node[anchor=south east] at (0,1) {2};
\end{tikzpicture}
\end{document}