0
\begin{tikzpicture}
    \begin{axis}[ymax=17,ymin=-1]
    \addplot [color=red, domain=-4:4, samples=50]{x^2};
     \node[label={180:{(1,5)}},circle,fill,inner sep=1.5pt] at (axis cs:1,5) {};
      \addplot [color=black!80, domain=-4:4, samples=50]{(-0.4)*(x+0.2)+(0.2^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{0};
      \addplot [color=black!80, domain=-4:4, samples=50]{(2)*(x)-1};
      \addplot [color=black!80, domain=-4:4, samples=50]{(-2)*x-1};
      \addplot [color=black!80, domain=-4:4, samples=50]{(-3)*(x+1.5)+(1.5^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{(3)*(x-1.5)+(1.5^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{(-4)*(x+2)+(2^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{(4)*(x-2)+(2^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{(1.2)*(x-0.6)+(0.6^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{(-1.2)*(x+0.6)+(0.6^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{(-0.8)*(x+0.4)+(0.4^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{(0.8)*(x-0.4)+(0.4^2)};
      \addplot [color=black!80, domain=-4:4, samples=50]{(0.4)*(x-0.2)+(0.2^2)};
    \end{axis}
\end{tikzpicture}

This is what im struggling with, the red graph of y=x^2 gets behind the black lines (they are tangents)

  • 2
    Graphs are drawn in the order you write them. Put the graph you want upmost last. – Christoph Frings Mar 7 at 20:37
  • 1
    Your code is not compileable! – AndréC Mar 7 at 20:40
  • You can use layers. – marmot Mar 7 at 21:10
  • Ok... Now i tried to move the \addplot for the parabola down, but no difference! marmot, what is a layer? – Hans Mar 9 at 17:39
  • I can't find any parabola in your code... If you draw a small circle first and over the circle you draw a filled rectangle... at least a part of the circle will be hidden below the filled rectangle... And this is because the circle was on the "first layer" and over that "layer" was the layer of the filled rectangle... over them could be another layer that the object of this last layer could hide parts from both the circle and the rectangle etc. PS: You have to ad a "@" before the name of a user to "ping" him in a way that he will get a notification about your comment... – koleygr Mar 9 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.