I need to do an empty plot for my students to fill. Surprisingly the options xtick=\empty
and ytick=\empty
do not work when the plot is empty:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[width=10cm, height=4cm, scale only axis,
axis lines=center,
xtick=\empty, ytick=\empty,
xlabel=$x$, ylabel=$f$]
% \addplot {x+1};
\end{axis}
\end{tikzpicture}
\end{document}
I have been able to achieve my ends with the option ticks=none
as explained here, but this is not totally satisfactory since this workaround does not allow to cancel ticks on a single axis if needed. Besides I was not able to find this option in the Pgfplots documentation.
Why the \empty
command does not work here?