## 我的问题 如何画$f(x,y)=0$之类的隐函数呢(比如$x^2+y^3+xy=2$的图像),我看TikZ文档里好像不太推荐使用外部程序的样子,集思广益一下,谢谢大家!

2 回答2

1
TikZ并没有不推荐使用外部程序,只是说明了使用TikZ作图的优势:一致性 这里使用了`gnuplot`作隐函数图像 ![](https://wenda.latexstudio.net/data/attach/200715/ySFH977r.png) ```tex \documentclass[border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \begin{document} \begin{tikzpicture} \begin{axis}[ axis x line = middle, axis y line = middle, xlabel = {$x$}, ylabel = {$y$}, xmin=-16, xmax=16, ymin=-12, ymax=7, legend pos=outer north east, legend style={draw=none}, ] \addplot +[no markers, raw gnuplot, thick, red, empty line = jump % not strictly necessary, as this is the default behaviour in the development version of PGFPlots ] gnuplot { set xrange [-15:15]; set yrange [-11:6]; set contour base; set cntrparam levels discrete 0.003; unset surface; set view map; set isosamples 500; set samples 500; splot x^2 + x*y + y^3 - 2; }; \addplot +[no markers, raw gnuplot, thick, blue, empty line = jump % not strictly necessary, as this is the default behaviour in the development version of PGFPlots ] gnuplot { set xrange [-15:15]; set yrange [-11:6]; set contour base; set cntrparam levels discrete 0.003; unset surface; set view map; set isosamples 500; set samples 500; splot exp(sqrt(x)+y) + cos(x) -1/x; }; \legend{$x^2 + xy + y^3=0$, $\exp(\sqrt{x}+y) + \cos x - 1/x$} \end{axis} \end{tikzpicture} \end{document} ```
0
右边相减文章里就有一个[通过TikZ绘制函数图像](https://wenda.latexstudio.net/article-5063.html "通过TikZ绘制函数图像")

你的回答

请登录后回答

你的回答将会帮助更多人,请务必认真回答问题。