[Tex/LaTex] How to plot a function without a y-axis

pgfplotstikz-pgf

I'm looking to design a question where students sketch a derivative based on a drawn function without the y-axis.

The y-axis is not important as we're focusing on the x-values of turning points and inflection points (in fact I don't need it at all).

I haven't managed to find a way to graph a function with only the x-axis (without the ticks or numbers is even better) with tikz or pgfplots.

Does anyone know how to do this?

Thanks in Advance!

Best Answer

What you're looking for is axis y line=none:

\documentclass[tikz]{standalone}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}

\begin{document}
\begin{tikzpicture}
  \begin{axis}[
      axis x line=middle,
      axis y line=none,
      domain=-360:360,
      xtick={-360, -330, ..., 360},
      samples=1001,
      xticklabels=\empty,
    ]
    \addplot [red!80!black] {sin(x)};
  \end{axis}
\end{tikzpicture}
\end{document}

output