识别配额 - TIKZ LaTeX

识别配额 - TIKZ LaTeX

在此处输入图片描述

\begin{tikzpicture}
    %   \draw[dashed] (-1, -1) grid (10, 5);%
    \draw[->] (-1,0) -- (10,0) node[right] {$h$};
    \draw[->] (0,-1) -- (0, 5) node[above] {$\gamma(h)$};
    \draw[black][domain=0:10] plot (\x,{1+2.5*(1-exp(-\x/1.2))})node[right] {$\hat\gamma(h)$};
    \setcounter{i}{0}
    \foreach \point in
    {(3,3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(1,3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.5,1)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.6,1.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(8,4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(8.5,4.6)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(7,2.88)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(5,3.3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(4.2,3.9)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(2.5,2.9)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(2.7,3.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(3.84,3.79)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(2.16,3.1)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(1.86,2.85)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(4.52,3.4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(1.658,2.5)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.85,2.4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(4.753,3.8)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(5.4,3.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(6,4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(6.4,3.8)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(6.7,3.6)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(9.5,3.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(9,4.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(8.85,3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(7.3,3.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.2,0.8)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.1,0.4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(1.45,3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(9.8,4.4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \draw[dotted][domain=0:10] plot (\x,{0.4+3.6*(1-exp(-\x/1.65))})node[right] {$\gamma(h)$};
    \draw (10.45, 4.85) node[below] {$\gamma^*(h_n)$};
    \end{tikzpicture}

我已经有了生成此黑色图像的代码,我已经设法实现了。我需要帮助在笛卡尔平面中插入标识配额,我需要制作的这些标识配额在图像中是红色的。

答案1

您有一个生成代码的程序吗?

\documentclass[tikz,border=3.14mm]{standalone}
\newcounter{i}
\begin{document}
\begin{tikzpicture}
    %   \draw[dashed] (-1, -1) grid (10, 5);%
    \draw[->] (-1,0) -- (10,0) node[right] {$h$};
    \draw[->] (0,-1) -- (0, 5) node[above] {$\gamma(h)$};
    \draw[black][domain=0:10] plot (\x,{1+2.5*(1-exp(-\x/1.2))})node[right] {$\hat\gamma(h)$};
    \setcounter{i}{0}
    \foreach \point in
    {(3,3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(1,3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.5,1)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.6,1.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(8,4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(8.5,4.6)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(7,2.88)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(5,3.3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(4.2,3.9)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(2.5,2.9)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(2.7,3.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(3.84,3.79)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(2.16,3.1)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(1.86,2.85)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(4.52,3.4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(1.658,2.5)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.85,2.4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(4.753,3.8)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(5.4,3.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(6,4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(6.4,3.8)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(6.7,3.6)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(9.5,3.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(9,4.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(8.85,3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(7.3,3.7)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.2,0.8)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(0.1,0.4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(1.45,3)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \setcounter{i}{0}
    \foreach \point in
    {(9.8,4.4)}
    {\node[coordinate] (point-\arabic{i}) at \point { };
        \fill (point-\arabic{i}) circle (0.05);
        \stepcounter{i}}
    \draw[dotted][domain=0:10] plot (\x,{0.4+3.6*(1-exp(-\x/1.65))})node[right] {$\gamma(h)$};
    \draw (10.45, 4.85) node[below] {$\gamma^*(h_n)$};
    \draw[red,|-|] (-1,0) -- (-1,1) node[midway,left] {$c_0$};
    \draw[red,|-|] (-1,1) -- (-1,3.4) node[midway,left] {$c_1$};
    \draw[red,|-|] (0,-1) -- (3,-1) node[midway,below] {$a$};
    \end{tikzpicture}
\end{document}

在此处输入图片描述

可以将其缩写为具有唯一名称的坐标:

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
    %   \draw[dashed] (-1, -1) grid (10, 5);%
    \draw[->] (-1,0) -- (10,0) node[right] {$h$};
    \draw[->] (0,-1) -- (0, 5) node[above] {$\gamma(h)$};
    \draw[black][domain=0:10] plot (\x,{1+2.5*(1-exp(-\x/1.2))})node[right] {$\hat\gamma(h)$};
    \foreach \point [count=\X] in {(3,3),(1,3),(0.5,1),(0.6,1.7),(8,4),(8.5,4.6),(7,2.88),(5,3.3),(4.2,3.9),(2.5,2.9),(2.7,3.7),(3.84,3.79),(2.16,3.1),(1.86,2.85),(4.52,3.4),(1.658,2.5),(0.85,2.4),(4.753,3.8),(5.4,3.7),(6,4),(6.4,3.8),(6.7,3.6),(9.5,3.7),(9,4.7),(8.85,3),(7.3,3.7),(0.2,0.8),(0.1,0.4),(1.45,3),(9.8,4.4)}
    { \fill \point coordinate (point-\X) circle (0.05);}
    \draw[dotted][domain=0:10]plot(\x,{0.4+3.6*(1-exp(-\x/1.65))})node[right]{$\gamma(h)$};
    \draw (10.45, 4.85) node[below] {$\gamma^*(h_n)$};
    \draw[red,|-|] (-1,0) -- (-1,1) node[midway,left] {$c_0$};
    \draw[red,|-|] (-1,1) -- (-1,3.4) node[midway,left] {$c_1$};
    \draw[red,|-|] (0,-1) -- (3,-1) node[midway,below] {$a$};
    \end{tikzpicture}
\end{document}

相关内容