![如何绘制这样的笛卡尔平面?](https://linux22.com/image/447976/%E5%A6%82%E4%BD%95%E7%BB%98%E5%88%B6%E8%BF%99%E6%A0%B7%E7%9A%84%E7%AC%9B%E5%8D%A1%E5%B0%94%E5%B9%B3%E9%9D%A2%EF%BC%9F.png)
答案1
这是一种可能性pstricks
:
\documentclass[border=6pt, svgnames]{standalone}
\usepackage{pst-plot, pst-node}
\begin{document}
\begin{pspicture}(-5,-5)(11,11)
\psset{arrowinset=0.12, plotpoints=200, algebraic, linejoin=1}
\psaxes[showorigin=false, ticksize=-3pt 3pt,labels=none, ticks=none]{->}(0,0)(-1,-1)(10,10)[$ x $, -140][$ y $, -130]
\pnodes(-1,-1){A}(9,9){B}
\ncline[linestyle=dashed]{A}{B}\naput[nrot=:U, npos=0.8]{$y=x$}
\psplot[linewidth=2pt, linecolor=RoyalBlue]{0.5}{4}{4*sin(x)-2*ln(x)+4}
\rput{-75}(2.7,5){$y = g(x)$}
\psline[linestyle=dashed](2.9,0)(2.9,2.9)(0,2.9)
\uput[d](2.9,0){$x'$}\uput[l](0,2.9){$x'$}
\end{pspicture}
\end{document}
答案2
使用tzplot
包,它基于TikZ
:
\documentclass[tikz]{standalone}
\usepackage{tzplot}
\begin{document}
\begin{tikzpicture}[scale=.8,font=\scriptsize]
% \tzhelplines(5,5)
\tzaxes(-.2,-.2)(5,5){$x$}[b]{$y$}[l]
\tzfn[dashed,thick]"line"{\x}[-.2:5]{$y=x$}[l]
\tzplotcurve[blue,thick]"curve"(.5,4.3)(1,4.2)(2.5,4.1)(4,.5){$y=g(x)$}[45]; % [ar] also works in version 2.0
% intersection and projection
\tzXpoint*{line}{curve}(X)
\tzproj(X){$x^*$}{$y^*$}
\end{tikzpicture}
\end{document}