我编写的创建它的代码如下:
\begin{tikzpicture}
\pgfplotsset{ticks=none}
\begin{axis}[axis lines=middle, tick style={very thick},xlabel={x}, ylabel={loss},]
%
%line of best fit
\addplot[yscale=0.7,ultra thick,samples=151,domain=0:10] {0.3*(x-5)^(2) + 1};
\end{axis}
\node[scale=2, red] (1) at (0.43,3) {\textbullet};
\node[scale=2, red] (2) at (0.55,2.7) {\textbullet};
\node[scale=2, red] (3) at (0.71,2.4) {\textbullet};
\node[scale=2, red] (4) at (0.87,2.1) {\textbullet};
\node[scale=2, red] (5) at (1.05,1.8) {\textbullet};
\node[scale=2, red] (6) at (1.27,1.5) {\textbullet};
\node[transparent] (6) at (0.15,3) {\textbullet};
\node[transparent] (7) at (0.3,2.7) {\textbullet};
\node[transparent] (8) at (0.51,2.4) {\textbullet};
\node[transparent] (9) at (0.67,2.1) {\textbullet};
\node[transparent] (10) at (0.9,1.8) {\textbullet};
\node[transparent] (11) at (1.2,1.5) {\textbullet};
\draw [<-] (6) -- (7);
\draw [<-] (7) -- (8);
\draw [<-] (8) -- (9);
\draw [<-] (9) -- (10);
\draw [<-] (10) -- (11);
\newline
\end{tikzpicture}
按照同样的逻辑,我编写了下面的代码来创建类似的图,但点的位置略有不同:
\begin{tikzpicture}
\pgfplotsset{ticks=none}
\begin{axis}[axis lines=middle, tick style={very thick},xlabel={x}, ylabel={loss},]
%
%line of best fit
\addplot[yscale=0.7,ultra thick,samples=151,domain=0:10] {0.3*(x-5)^(2) + 1};
\end{axis}
\node[scale=2, red] (1) at (0.43,3) {\textbullet};
\node[scale=2, red] (2) at (0.64,2.5) {\textbullet};
\node[scale=2, red] (3) at (0.9,2) {\textbullet};
\node[scale=2, red] (4) at (1.25,1.5) {\textbullet};
\node[scale=2, red] (5) at (1.61,1) {\textbullet};
\node[scale=2, red] (6) at (2.1,0.5) {\textbullet};
\node[transparent] (60) at (0.1,3) {\textbullet};
\node[transparent] (70) at (0.3,2.5) {\textbullet};
\node[transparent] (80) at (0.6,2) {\textbullet};
\node[transparent] (90) at (1,1.5) {\textbullet};
\node[transparent] (100) at (1.4,1) {\textbullet};
\node[transparent] (110) at (1.85,0.5) {\textbullet};
\draw [->] (60) -- (70);
\draw [->] (70) -- (80);
\draw [->] (80) -- (90);
\draw [->] (90) -- (100);
\draw [->] (100) -- (110);
\newline
\end{tikzpicture}
然而,生成的图像就是您在此处看到的图像,基本上箭头的主体没有显示出来,即使有足够的空间(请注意,上一个图像的空间更小,但主体仍然显示出来)。如果不是坐标变化,想法完全相同,代码也几乎相同。您知道为什么会这样以及如何解决它吗?
这是我得到的:
我检查过类似这样的帖子,但它们没有帮助,因为那里的问题不同: