I want to plot an equation, not a function, with TikZ. Is there any general way to realize it without calculation?
For example to plot the equation: 2x²-2xy+2y²=1 as follows
This (standing on the shoulder of giants) works. There is a warning Missing character: There is no ` in font nullfont! which I do not like at all, but I am not sure where it comes from.
You must compile with -shell-escape and have a recent gnuplot installed and reachable in your standard PATH.
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
grid,
xmin = -1, xmax=3,
ymin=-1, ymax=1,
]
\addplot +[no markers,
raw gnuplot,
thick,
empty line = jump %
] gnuplot {
set xrange[-1:3];
set contour base;
set cntrparam levels discrete 0.0;
unset surface;
set view map;
set isosamples 500;
splot 2xx-2xy+2yy-1;
};
\path (1,0.5) node[right, fill=white]{$2x^2-2xy+2y^2=1$};
\end{axis}
\end{tikzpicture}
\end{document}
\node at (1.5, 0.4) {$2 x^2 ...$};. That should do the job. – MS-SPO Jun 12 '22 at 10:522x^2 - 2xy + 2y^2 = 1; solve (y):y = 1/2 (x - sqrt(2 - 3 x^2)), y = 1/2 (x + sqrt(2 - 3 x^2))– Alexander Wittmann Jun 12 '22 at 11:09gnuplot: https://tex.stackexchange.com/questions/18359/plotting-an-implicit-function-using-pgfplots – Rmano Jun 12 '22 at 11:18