Tikz 箭头展示微积分中的极限

Tikz 箭头展示微积分中的极限

我正在尝试重现此图像。这是我目前所拥有的,但我不知道从哪里开始在图表上放置箭头。欢迎提出所有建议。

\documentclass{article}
\usepackage{tikz}
\begin{tikzpicture}[scale=.6,cap=round]
\tikzset{axes/.style={}}
  % The graphic
 \draw[style=help lines,step=1cm, dotted] (-7,-7) grid (7.0,7.0);
 \begin{scope}[style=axes]
 \draw[->] (-7.5,0) -- (7.5,0) node[above] {$x$};
 \draw[->] (0,-7.5)-- (0,7.5) node[left] {$y$};
     \foreach \x/\xtext in {-6/-12, -5/-10, -4/-8, -3/-6, -2/-4,    1/2, 2/4, 3/6, 4/8, 5/10, 6/12}
 \draw[xshift=\x cm] (0pt,2.6pt) -- (0pt,-2.6pt) node[below,fill=white]
      {\scriptsize $\xtext$};
     \foreach \y/\ytext in {-6/-12, -5/-10, -4/-8, -3/-6, -2/-4,    2/4, 3/6, 4/8, 5/10, 6/12}
 \draw[yshift=\y cm] (2.6pt,0pt) -- (-2.6pt,0pt) node[left,fill=white]
     {\scriptsize $\ytext$};
 \filldraw[black] (2,5.5) circle (3pt) node[fill=white,left=3pt] {$$};
 \draw[domain=-4.1:2.9,smooth,variable=\x,black,<->,thick] plot ({\x},{.5*(3+4*\x)});
 \node at (-5.5,-4) [fill=white] {$f(x)=2x+3$};
 \draw[dashed] (2.5,0)--(2.5,6.5)--(0,6.5);
 \draw[dashed] (1.5,0)--(1.5,4.5)--(0,4.5);
 \end{scope}
 \end{tikzpicture}

\结束{文档}

输出:

在此处输入图片描述

但我正在尝试重现:

在此处输入图片描述

答案1

您可以使用shapes.arrows或只画带箭头的粗线。以下示例说明了这两种选择。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows,matrix,positioning}
\begin{document}
\begin{tikzpicture}[scale=.6,cap=round]
\tikzset{axes/.style={}}
  % The graphic
 \draw[style=help lines,step=1cm, dotted] (-7,-7) grid (7.0,7.0);
 \begin{scope}[style=axes]
 \draw[->] (-7.5,0) -- (7.5,0) node[above] {$x$};
 \draw[->] (0,-7.5)-- (0,7.5) node[left] {$y$};
 \foreach \x/\xtext in {-6/-12, -5/-10, -4/-8, -3/-6, -2/-4,    1/2, 2/4, 3/6, 4/8, 5/10, 6/12}
 {\ifnum\x=2
  \else
     \draw[xshift=\x cm] (0pt,2.6pt) -- (0pt,-2.6pt) node[below,fill=white,font=\scriptsize]
      {$\xtext$};
  \fi     
 }    
 \foreach \y/\ytext in {-6/-12, -5/-10, -4/-8, -3/-6, -2/-4,    2/4, 3/6, 4/8, 5/10, 6/12}
     \draw[yshift=\y cm] (2.6pt,0pt) -- (-2.6pt,0pt) node[left,fill=white,font=\scriptsize]
     {$\ytext$};
 \filldraw[black] (2,5.5) circle (3pt) node[fill=white,left=3pt] {};
 \draw[domain=-4.1:2.9,smooth,variable=\x,black,<->,thick] plot ({\x},{.5*(3+4*\x)});
 \node at (-5.5,-4) [fill=white] {$f(x)=2x+3$};
 \draw[dashed] (2.5,0)--(2.5,6.5)--(0,6.5);
 \draw[dashed] (1.5,0)--(1.5,4.5)--(0,4.5);
 \end{scope}
 \draw[cyan,thick] (0,5.5) -- (-1,5.5) node[left,font=\scriptsize](11){11};
 \node[single arrow,cyan,minimum height=1.5cm,rotate=-90,fill,transform
 shape,anchor=east,opacity=0.3] at(11.north){};
 \node[single arrow,cyan,minimum height=1.5cm,rotate=90,fill,transform
 shape,anchor=east,opacity=0.3] at(11.south){};
 \draw[red,thick] (2,0) -- (2,-9.8);
 \node[text=red,fill=white,font=\scriptsize] (4) at (2,-1.5) {4};
 \node[single arrow,red,minimum height=1.5cm,rotate=0,fill,transform
 shape,anchor=east,opacity=0.3] at(4.west){};
 \node[single arrow,red,minimum height=1.5cm,rotate=180,fill,transform
 shape,anchor=east,opacity=0.3] at(4.east){};
 %
 \matrix[matrix of math nodes,nodes={text width=11mm,align=right,inner sep=3pt,
 text height=1.5ex,text depth=.25ex,draw=gray!40,ultra thin},draw,inner
 sep=0pt] (mat)
 at (1.1,-11){
 |[fill=green!40!gray,align=left]| x & 3.9& 3.99 & 3.999 & |[text=red!90,align=center]| 4 & 4.001 & 4.01 & 4.1\\
 |[fill=green!40!gray,align=left]| f(x) & 10.8 & 10.98 & 10.998 & |[text=cyan!90,align=center]| 11 & 
 11.002& 11.02& 11.2 \\
 };
 \draw[thin,gray!40] (mat.west) -- (mat.east);
 \node[left=2mm of mat-1-1,text width=2cm,font=\itshape]{Limit};
 \node[left=2mm of mat-2-1,text width=2cm,font=\itshape]{Numerically};
 \draw[line width=1mm,-latex,red!90] ([xshift=3mm,yshift=8mm]mat-1-2.north west)
 node[xshift=-2mm,anchor=south west,align=left,font=\scriptsize]{These input values\\
  approach 4 from the left.}
 --([xshift=2mm,yshift=8mm]mat-1-5.north west);
 \draw[line width=1mm,latex-,red!90] ([xshift=-2mm,yshift=8mm]mat-1-5.north east)
 node[xshift=2mm,anchor=south west,align=left,font=\scriptsize]{These input values\\
  approach 4 from the right.}
 --  ([xshift=-1mm,yshift=8mm]mat-1-8.north east);
 \draw[line width=1mm,-latex,cyan!90] ([xshift=3mm,yshift=-8mm]mat-2-2.south west)
 node[xshift=-2mm,anchor=north west,align=left,font=\scriptsize]{These output values\\
  approach 11 from the left.}
 --([xshift=2mm,yshift=-8mm]mat-2-5.south west);
 \draw[line width=1mm,latex-,cyan!90] ([xshift=-2mm,yshift=-8mm]mat-2-5.south east)
 node[xshift=2mm,anchor=north west,align=left,font=\scriptsize]{These output values\\
  approach 11 from the right.}
 --  ([xshift=-1mm,yshift=-8mm]mat-2-8.south east);
\end{tikzpicture}
\end{document}

在此处输入图片描述

顺便说一句,你忘了\begin{document}\end{document}在你的例子中真的如果您提供表格和将来需要输入的所有内容,将会有所帮助。

相关内容