The following code gives me a plot which is not very smooth. It looks like several points (with spacing 0.5 in the horizontal direction) are drawn first and then connected by straight lines. What options do I have to modify to make it smoother? Thanks.
\documentclass[]{standalone}
\usepackage{xcolor}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
scale=0.8,
axis lines=middle,
grid=major,
xmin=-5,
xmax=5,
ymin=-5,
ymax=5,
xlabel=$x$,
ylabel=$y$,
xtick={-4,-3,...,5},
ytick={-4,-3,...,4},
tick style={very thick}
]
\addplot[domain=-6:6, blue, ultra thick] {x^3-x};
\end{axis}
\end{tikzpicture}
\end{document}
samples=<number>
25
) Also it is advantageous to use an odd number of samples for a symmetric domain to have 0 included.