图形图像


如果要包含一个来自外部文件的图形图像,可以用“graphicx”包,在beamer中,命令 “\includegraphics”支持覆盖规范

\includegraphics<覆盖规范>[选项]{文件名}
比如
\begin{frame}
\includegraphics<1>[height=2cm]{step1.pdf}%
\includegraphics<2>[height=2cm]{step2.pdf}%
\includegraphics<3>[height=2cm]{step3.pdf}%
\end{frame}

事实上用“pgf”包的“\pgfuseimage”和“\pgfimage”也支持覆盖规范。

如果想用包提供的图形命令,建议使用“tikz”,其它包,如“pstricks”在某些编译器上无法通过。 事实上“tikz”和覆盖规范一起工作得相当不错。比如

\begin{frame}
\begin{center}
\begin{tikzpicture}[xscale=0.5,yscale=0.03,smooth]
\draw[->] (0,0)--(12,0) node[right] {$x$};
\draw[->] (0,0)--(0,150) node[above] {$y$};
\only<1->
{
\draw[blue,domain=1:12] plot (\x,40) node[right] {$y=40$};
}
\only<2->
{
\draw[red,domain=1:12] plot (\x,{10*(\x)}) node[right] {$y=10x$};
}
\only<3->
{
\draw[orange,domain=1:9.5] plot (\x,{0.4*pow(2,\x - 1)}) node[right] {$y=0.4 \times 2^{x-1}$};
}
\end{tikzpicture}
\end{center}
\end{frame}


目录