1

Actually want to draw this curve exactly but dunno how to plot it from the points and can't remove the axis values

\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
    grid style=dashed,
] 
\addplot[color=blue]
    coordinates {
    (-6,10)(-5,9.5)(-4,8.4)(-3,6.8)(-2,4.75)(-1,2.3)(0,0)(1,2.3)(2,4.75)(3,6.8)(4,8.4)(5,9.5)(6,10)
    };

\end{axis}
\end{tikzpicture}
\caption{phonon-4}
\end{figure}

enter image description here

Please help me thanks a lot

  • how to add code properly i don't know that sorry and thanks – Quintis Jun 15 at 4:51
3

If your question is to remove the tick labels: xticklabels={},yticklabels={}.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[axis x line=bottom,axis y line=middle,
    grid=both,minor grid style={densely dotted,gray,ultra thin},
    minor xtick={-2.5,-1.5,...,2.5},minor ytick={0.1,0.3,...,0.9},
    xticklabels={},yticklabels={},trig format=rad]
    \addplot[color=red,domain=-pi:pi,smooth,samples=51] {abs(sin(x/2))};
  \end{axis}
\end{tikzpicture}
\end{document}

enter image description here

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.