Graphics, Figures & Tablespstricks in Beamer

Information and discussion about graphics, figures & tables in LaTeX documents.
5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

pstricks in Beamer

Post by 5gon12eder »

It seems to me that the easiest solution to this would be drawing a semitranspartent rectangle above the image.

With the rest of the code like in the first of my before two suggestions, try:

Code: Select all

\begin{wrapfigure}{R}{3.1cm}
  \setlength{\unitlength}{1.0cm}
  \begin{pspicture}(-1,-1)(2,2)
    \psline[linewidth=2pt]{->}(-.5,0)(1.5,0)
    \put(1.6,-0.1){x}
    \psline[linewidth=2pt]{->}(0,-.5)(0,1.5)
    \put(-0.1,1.7){y}
    \psline[arrowsize=3pt 2, linewidth=0.06,linecolor=red]{->}(-0.00,0)(1.25,1.25)
    \put(0.5,1.0){$\vec{A}$}
    \only<-4>
        {
            \psframe[fillstyle=solid,fillcolor=white,opacity=0.9,linestyle=none](-1,-1)(2,2)
        }
  \end{pspicture}
\end{wrapfigure}
But if you wish to uncover the picture piecewise, then a little more trickery is to be done. Here is a suggestion that took me more time than expected to get it working. But I'm still not very happy about.

As in the second of my above two suggestions but add to the preamble:

Code: Select all

\newcommand{\opacityfunction}{0.1}
\newcommand{\restoreopacityfunction}{\renewcommand{\opacityfunction}{0.1}}
\newcommand<>{\setopacityfunction}{\restoreopacityfunction\only#1{\renewcommand{\opacityfunction}{1}}}
And draw the picture as:

Code: Select all

\begin{wrapfigure}{R}{3.1cm}
  \setlength{\unitlength}{1.0cm}
  \begin{pspicture}(-1,-1)(2,2)
    \setopacityfunction<5->
    \psline[linewidth=2pt,strokeopacity=\opacityfunction]{->}(-.5,0)(1.5,0)
    \uncover<5->{\put(1.6,-0.1){x}}
    \setopacityfunction<6->
    \psline[linewidth=2pt,strokeopacity=\opacityfunction]{->}(0,-.5)(0,1.5)
    \uncover<6->{\put(-0.1,1.7){y}}
    \setopacityfunction<7->
    \psline[arrowsize=3pt 2, linewidth=0.06,linecolor=red,strokeopacity=\opacityfunction]{->}(-0.00,0)(1.25,1.25)
    \uncover<7->{\put(0.5,1.0){$\vec{A}$}}
  \end{pspicture}
\end{wrapfigure}
It would of course be much nicer to make use of beamer's \renewcommand<>. But I couldn't manage this yet.

Best
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply