如何在 TikZ 中绘制附加函数

如何在 TikZ 中绘制附加函数

如何绘制附加函数TikZ

\begin{tikzpicture}[line width=0.2mm,font=\scriptsize]
\draw[-latex] (-1.5,0) -- (3,0);
\draw[-latex] (0,-1) -- (0,3);
\draw[dashed] (0,2) node[left]{$L$} -| (2,0)node[below]{$a$};
\filldraw (2,2) circle (.05cm);

\begin{scope}[xshift=5.5cm]
\draw[-latex] (-1.5,0) -- (3,0);
\draw[-latex] (0,-1) -- (0,3);
\draw[dashed] (0,2) node[left]{$L$} -| (2,0)node[below]{$a$};
\draw[fill=white] (2,2) circle (.05cm);
\filldraw (2,1.5) circle (.05cm);
\end{scope}

\begin{scope}[xshift=11cm]
\draw[-latex] (-1.5,0) -- (3,0);
\draw[-latex] (0,-1) -- (0,3);
\draw[dashed] (0,1.5) node[left]{$L$} -| (2,0)node[below]{$a$};
\draw[fill=white] (2,1.5) circle (.05cm);
\end{scope}
\end{tikzpicture}

在此处输入图片描述

答案1

一种方法是将曲线数字化,为每个函数生成一组坐标。我用数据窃贼。您可以编辑坐标以更好地表示所需的功能。我追踪了曲线,因此它们“如 OP 所画”。

然后你可以这样做:

\documentclass{article}
%Adapted from https://tex.stackexchange.com/a/582126/
\usepackage{tikz}
\usetikzlibrary{calc,arrows,hobby}
\begin{document}

\tikzset{
    axis/.style={very thick, ->, >=stealth'},
    important line/.style={thick},
    dashed line/.style={dashed, thick},
    every node/.style={color=black,},
    use Hobby shortcut
}

\begin{tikzpicture}[scale=1.5]
\draw[axis] (-1.5,0)  -- (3,0) node(xline)[right] {$x$};
\draw[axis] (0,-1) -- (0,3) node(yline)[above] {$y$};
\draw[dashed] (0,2) node[left]{$L$} -| (2.25,0)node[below]{$a$};
\draw[orange, ultra thick] (-1.2284, -1.1983) .. (-1.2361, -0.9178) .. (-1.2238, -0.6509) .. (-1.1841, -0.3265) .. (-1.152, -0.0731) .. (-1.0925, 0.1518) .. (-1.0433, 0.3444) .. (-0.9792, 0.5933) .. (-0.8953, 0.8286) .. (-0.8034, 1.0413) .. (-0.7031, 1.2236) .. (-0.5702, 1.3937) .. (-0.4181, 1.558) .. (-0.2403, 1.7172) .. (-0.0467, 1.8311) .. (0.1509, 1.8907) .. (0.345, 1.9109) .. (0.478, 1.8154) .. (0.5706, 1.6688) .. (0.633, 1.5034) .. (0.7085, 1.3316) .. (0.8199, 1.187) .. (0.9546, 1.0682) .. (1.0929, 0.9888) .. (1.2397, 0.9651) .. (1.4025, 0.982) .. (1.5967, 1.0882) .. (1.7516, 1.2137) .. (1.8771, 1.3987) .. (2.0036, 1.5681) .. (2.0858, 1.7407) .. (2.1674, 1.9211) .. (2.2547, 2.1099) .. (2.3403, 2.3219) .. (2.4031, 2.5003) .. (2.4733, 2.6639) .. (2.5733, 2.9399);
\filldraw (2.25,2) circle (.05cm);
\end{tikzpicture}\hspace{1.5cm}%
\begin{tikzpicture}[scale=1.5]
\draw[axis] (-1.0,0)  -- (3,0) node(xline)[right] {$x$};
\draw[axis] (0,-1) -- (0,3) node(yline)[above] {$y$};
\draw[dashed] (0,1.5) node[left]{$L$} -| (1.10,0)node[below]{$a$};
\draw[orange, ultra thick] (-0.8356, 0.6491) .. (-0.826, 0.762) .. (-0.8034, 0.8632) .. (-0.769, 0.9373) .. (-0.7316, 1.0162) .. (-0.6842, 1.1044) .. (-0.6198, 1.1804) .. (-0.5514, 1.23) ..
(-0.4668, 1.2728) .. (-0.3854, 1.3107) .. (-0.303, 1.3174) .. (-0.2168, 1.3237) .. (-0.1126, 1.2867) .. (-0.0206, 1.2043) .. (0.0683, 1.117) .. (0.1518, 1.0407) .. (0.2429, 0.9636) 
.. (0.335, 0.8812) .. (0.4161, 0.8466) .. (0.5, 0.8428) .. (0.573, 0.8868) .. (0.615, 0.986) .. (0.6417, 1.0608) .. (0.689, 1.149) .. (0.776, 1.176) .. (0.8629, 1.2029) .. (0.9243, 1.2482)
 .. (0.9788, 1.289) .. (1.014, 1.3577) .. (1.0776, 1.439) .. (1.1203, 1.5588) .. (1.143, 1.66) .. (1.1989, 1.7421) .. (1.2549, 1.7983) .. (1.3326, 1.8107) .. (1.4136, 1.7761) 
 .. (1.4656, 1.6824) .. (1.5152, 1.5787) .. (1.5643, 1.4802) .. (1.6354, 1.4104) .. (1.7008, 1.4293) .. (1.7568, 1.4855) .. (1.7795, 1.5607) .. (1.7993, 1.6571) .. (1.8051, 1.7445)
  .. (1.807, 1.8324) .. (1.8189, 1.9296) .. (1.8401, 2.0154) .. (1.8645, 2.0801) .. (1.9013, 2.1384) .. (1.9588, 2.184) .. (2.0196, 2.2086) .. (2.0929, 2.1749) .. (2.1748, 2.1091) 
  .. (2.2, 1.9924) .. (2.2174, 1.8765) .. (2.2311, 1.7351) .. (2.2501, 1.6088) .. (2.3038, 1.4787) .. (2.3535, 1.3749) .. (2.4147, 1.2958) .. (2.4821, 1.2005) .. (2.5686, 1.1291) ;
\filldraw (1.10,1.5) circle (.05cm);
\end{tikzpicture}

\end{document}

要获得这个:

在此处输入图片描述

相关内容