2

Hell, im trying to create a plot with some arrows like the one shown below. enter image description here

The code I wrote to create it is the one below:

\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}

Following the same logic, I wrote the code below to create a similar plot but with the dots being at somewhat different places:

\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}

However the image produced is the one you can see here, basically the bodies of the arrows are not shown, even though there is enough space (Mind you the previous image has even less space and the bodies still show). The idea is exactly the same and the code is almost identical if it wasnt for the coordinate changes. Do you have any ideas why that would be and how to solve it ?

This is what I get:

enter image description here

I have checked posts like these but they have not been helpful as the issue there is different:

7
  • Possibly you have redefined somewhere the arrow (or its default line width has been set to zero). On overleaf your code (with the basic preamble) works as expected.
    – koleygr
    Aug 24 at 18:14
  • Welcome to TeX.SE!
    – Mensch
    Aug 24 at 18:20
  • @koleygr I havent messed with the arrow settings and the two code pieces are one below the other so nothing could change between them.
    – wwatzy
    Aug 24 at 19:13
  • Thank you @Mensch
    – wwatzy
    Aug 24 at 19:29
  • 4
    I’m voting to close this question because OP solved it himself. Aug 27 at 5:03

0