如何创建“气泡状”标注来描述图形函数?

如何创建“气泡状”标注来描述图形函数?

我想用 PSTricks 画下图,但我不知道如何画“气泡状”的标注。有人能帮忙吗?

在此处输入图片描述

答案1

来自pstricks-add.texhttp://archiv.dante.de/~herbert/TeXnik/tex/generic/pstricks-add/

\documentclass[margin=3mm,pstricks]{standalone}
\usepackage{pstricks-add}
\begin{document}

\begin{pspicture}(-3,-1)(4,5.5)
\psaxes[labels=none,ticks=none]{->}(0,0)(-2.5,-1)(3.5,5)[$x$,-90][$y$,0]
\psyTick(1){1}\uput[225](0,0){0}
\psplot[algebraic,yMaxValue=4.5,linecolor=red,linewidth=1.5pt]{-2.5}{3}{Euler^(-(x))}
\psCallout(1,0.6){\scriptsize $f(x)=e^{-x}$}
\end{pspicture}

\end{document}

在此处输入图片描述

\documentclass[margin=3mm,pstricks]{standalone}
\usepackage{pstricks-add}
\begin{document}

    \begin{pspicture}(-3,-1)(4,5.5)
    \psaxes[labels=none,ticks=none]{->}(0,0)(-2.5,-1)(3.5,5)[$x$,-90][$y$,0]
    \psyTick(1){1}\uput[225](0,0){0}
    \psplot[algebraic,yMaxValue=4.5,linecolor=red,linewidth=1.5pt]{-2.5}{3}{Euler^(-(x))}
    \psCallout(1,0.6){\scriptsize $f(x)=e^{-x}$}
    \psCallout[tipAngle=120,tipPos=0.6,linearc=0.5,
       fillcolor=blue!30,fillstyle=solid](-1,0.2){\shortstack{negative\\axis}}
    \end{pspicture}

\end{document}

在此处输入图片描述

答案2

一个简单的 TiZ 解决方案仅用于比较目的:

\documentclass[margin=3mm,tikz]{standalone}
\usetikzlibrary{shapes,calc}
\begin{document}
\begin{tikzpicture}
    \draw[->] (0,-1)--(0,3) node[left] {$y$};
    \draw[->] (-3,0)--(3,0) node[below]{$x$};
    \draw[fill=black] (0,1) circle (0.5pt)  node[below left]{1};
    \draw (0,0) node[below left] {$O$};
    \draw plot[smooth,domain=-1:2.5] (\x,{exp(-(\x))});
    \node (root) at (1+0.1,1/e+0.1) {};
    \node[
        rectangle callout, 
        draw,
        yshift=1cm,
        xshift=2cm,
        callout absolute pointer={(root)}
    ] {\scriptsize $f(x)=e^{-x}$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容