I am able to draw parabolic curves in tikz by using \draw and parabola bend

        \draw (-3,4) parabola bend (0,-.5) (3,4);

However I would like to draw this parabola mirrored over the line y=x. I attempted to input what seemed like sensible points:

        \draw (4,-3) parabola bend (-.5,0) (4,3);

However this creates a broken curve and it is quite clear that tikz is not intended to take input in this way. Is there someway I could get a sideways parabolic curve using \draw in a similar fashion to how I obtained the first curve?


The parabola path command makes only parabolas of the kind y=a*x+b, still you're free to rotate, scale, slant it or whatever. So you want to mirrow it, the question remains: Can we mirror a part in tikz? Oh yes we can:

enter image description here



% Code from user Qrrbrbirlbel (https://tex.stackexchange.com/a/142491/81905)
\def\pgftransformxmirror#1{\pgfmathparse{2*(#1)}\pgftransformcm{-1}{0}{0}{1}{\pgfqpoint{+\pgfmathresult pt}{+0pt}}}
\def\pgftransformymirror#1{\pgfmathparse{2*(#1)}\pgftransformcm{1}{0}{0}{-1}{\pgfqpoint{+0pt}{+\pgfmathresult pt}}}
    \pgftransformymirror{\tikz@temp pt}%
    \pgftransformxmirror{\tikz@temp pt}%
%End of code from Qrrbrbirlbel

\draw (-3,4) parabola bend (0,-.5) (3,4);
\draw[thick, <->] (-3,0) -- (3,0);
\draw[thick, <->] (0,-3) -- (0,4);
\coordinate (1) at (-3,-3);
\coordinate (2) at (3,3);
\draw[dashed,very thin] (1)--(2);
\draw[mirror=(1)--(2),red] (-3,4) parabola bend (0,-.5) (3,4);
  • Thank you for the answer. I unfortunately was unable to get Qrrbrbirlbel's code to work for me and ended up just switching my axes. – Sriotchilism O'Zaic Jan 31 '17 at 7:04
  • That's also another nice possibility, you should add that as an answer. Would mind elaborating on why the code did not work? Was there an error? Did the above MWE raised any issues? – Guilherme Zanotelli Jan 31 '17 at 8:16
  • I don't think I will add an answer because the solution I was using would not be the solution I would have wanted when I asked the question. I literally just switched the labels on my axes so that the graph was technically the correct one. I did end up getting your solution to work just fine in the end, so thanks! – Sriotchilism O'Zaic Feb 1 '17 at 3:09

A simple fix to consider:

        \draw[rotate=-90] (-3,4) parabola bend (0,-.5) (3,4);

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.