0
\begin{tikzpicture}[scale=1.6]
    \begin{axis}[
                 xmin=-0.02,xmax=0.12,
                 ymin=-2,ymax=15,legend style={nodes={scale=0.6, transform shape}}, 
        legend image post style={mark=*}, xlabel=$Axialrichtung (mm)$,ylabel=$Spannung (MPa)$]
    \addplot[only marks,mark=*,blue] table{O-ring2-N-0.2.txt};

     \draw[red] (axis cs: -0.02, 0) -- (axis cs: 0, 11.045);
     \draw[red](axis cs: 0,11.045) parabola bend ( axis cs: 0.1,0) (axis cs: 0,-11.045) ;
    \end{axis}
\end{tikzpicture}

enter image description here

It should be one parabola open to left, not two*0.5 parabolas open to up and down. Where am I wrong?

1

Welcome to this site! You need to rotate the parabola, the standard construction is only for "upright" parabolae. Please also provide complete codes. Further information can be found in the comments in the following (complete) code.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
%\pgfplotsset{compat=1.16}%<- it would be better to use the latest version
\begin{document}
\begin{tikzpicture}
    \begin{axis}[scale=1.6,%<- put scale into the axis options
                 xmin=-0.02,xmax=0.12,
                 ymin=-2,ymax=15,legend style={nodes={scale=0.6, transform shape}}, 
        legend image post style={mark=*}, xlabel={Axialrichtung (mm)},
        ylabel={Spannung (MPa)}]%<- removed math mode
    %others do not have your data files 
    %\addplot[only marks,mark=*,blue] table{O-ring2-N-0.2.txt};
     \draw[red] (axis cs: -0.02, 0) -- (axis cs: 0, 11.045);
    %define symbolic coordinates (don't get transformed) 
     \path (axis cs: 0,11.045) coordinate (tmp1)
      (axis cs: 0.1,0) coordinate (tmp2) (axis cs: 0,-11.045) coordinate (tmp3);
    %draw *rotated* parabola
     \draw[red,rotate=90] (tmp1) parabola bend (tmp2) (tmp3) ;
    \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |
  • Thank you very much!! – Anzu An Oct 3 '19 at 13:23

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.