# "Anti-aliasing" (smoothness of curve) in TikZ

Is there a way to increase the smoothness of a curve created by TikZ? I think, it's a problem with my TeX distribution (TeX Live on Manjaro). Compare it with the output below, which I created with gnuplot manually.

First plot (worse plot):

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\clip(-4,-4) rectangle (1,4);

\draw plot[ raw gnuplot, smooth] function{
f(x,y) = x**3-4*x+1-y**2;
set isosamples 1000;
set cont base;
set cntrparam levels incre 0,0.1,0;
set view map;      %for gnuplot manually
unset surface;
splot f(x,y);
};
\end{tikzpicture}
\end{document}


The upper and the lower section of the arc are quite edged.

To see the output, run the code with the option -shell-escape.

How many lines does your .pgf-plot.table output file consist of? Mine consists of 1509 lines.

Second plot (better plot):

Use \draw plot file{***} instead while *** stands for the file name of the table created by gnuplot manually (1612 lines). But I don't know anymore how I managed to get this table file. Is there a difference between cont and contour or incre or increment? I tested cont and cont base or levels discrete 0 all over the place, but don't know the right commands anymore, either the right order.

• Comments are not for extended discussion; this conversation has been moved to chat. Aug 31 '17 at 20:11

I've found a solution by adding the line set samples 1000; to the plot command.

\draw plot[ raw gnuplot, smooth] function{
f(x,y) = x**3-4*x+1-y**2;
set isosamples 1000;
set samples 1000;    % or 500 is still sufficient
set cont base;
set cntrparam levels incre 0,0.1,0;
set view map;      % for gnuplot manually
unset surface;
splot f(x,y);
};