As my previous post suggested, I was tweaking the pgfplots code a little, to produce a nice algebraic curve from gnuplot data. The current behaviour just connects all the dots in the automatically produced .table file. But as the calculation of an implicit function in gnuplot involves the creation of a surface and intersecting it with the z=0 plane, the output is not as good as it would be in the case of a regular function.

But, I've hacked together a solution! Just replace the definition of \pgf@readxyfile by

\def\pgf@readxyfile{%
  \read1 to \pgf@temp%
  \let\par=\pgf@savedpar%
  \edef\pgf@temp{\pgf@temp}%
  \ifx\pgf@temp\pgfutil@empty%
  \else\ifx\pgf@temp\pgf@partext%
    \pgfplotstreamstart%
    \pgfplotstreamend%
  \else%
    \expandafter\pgf@parsexyline\pgf@temp\pgf@stop%
  \fi\fi%
  \ifeof1\else\expandafter\pgf@readxyfile\fi%
}

It actually went quite smooth, it took me less than an hour to start reading the source (after a tip on tex.stackexchange.com) to find the solution, write an answer for my topic and write two blog posts about it.

By the way, the code to produce the plot is

\begin{tikzpicture}[xscale=1,yscale=.25]
  \draw plot[id=curve, raw gnuplot, smooth] function{
    f(x,y) = y**2 + (x**2 - 5)*(4*x**4 - 20*x**2 + 25);
    set xrange [-4:4];
    set yrange [-15:15];
    set view 0,0;
    set isosample 1000,1000;
    set table;
    set size square;
    set cont base;
    set cntrparam levels incre 0,0.1,0;
    unset surface;
    splot f(x,y)
  };
\end{tikzpicture}

So in case you've always wondered how to draw algebraic curves or implicit functions in LaTeX, this is my hackish solution! Any comments on this?

For people looking at how to draw implicit functions using pgfplots, I refer you to Howto: Draw Algebraic curves using TikZ.