答案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}