Hi<br><br><br>Thanks! I didn't know the package overpic available. <br>The mask I want to place on the stress contour plot has an irregular shape as a sin curve. I need to generate such a masking figure in photoshop first then place it over the contour plot. so that the areas out of the two walls are white. It is difficult to make this clear without actual pictures: The two walls are sin curve instead of a line. <br>
Thanks again.<br><br><br><br>Best wishes, <br>Jene<br><br><br><br><br><div class="gmail_quote">On Thu, Feb 24, 2011 at 9:16 AM, Steve Schwartz <span dir="ltr"><<a href="mailto:s.schwartz@imperial.ac.uk">s.schwartz@imperial.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Jene,<br>
<div><div></div><div class="h5"><br>
On Wed, 2011-02-23 at 23:25 +0000, Paulga wrote:<br>
<br>
> I have a sinusoidal wave figure showing the contour of polymer stress.<br>
> When I place it into my pdf file I  would like to put a masking layer<br>
> on it so that only the part of contour between the top and bottom<br>
> walls of the wave is visible, the area outside blank. But I cannot<br>
> find any method how to achieve this. Any help would be appreciated.<br>
> Thanks in advance.<br>
<br>
</div></div>I often do something similar to replace tiny graph labels with bigger<br>
ones by masking out the originals and placing my own.<br>
<br>
One solution is to use overpic and to draw the necessary blanking frame<br>
with picture commands, e.g.:<br>
<br>
\documentclass{article}<br>
\usepackage{graphicx}<br>
\usepackage{overpic}<br>
\usepackage{pict2e}<br>
\usepackage{color}<br>
<br>
\begin{document}<br>
<br>
Hello\par<br>
\framebox{<br>
\begin{overpic}[width=\textwidth,grid]{<image-file>}<br>
        \put(10,5){\linethickness{5\unitlength}\color{white}\line(1,0){40}}<br>
\end{overpic}<br>
}\par<br>
Goodbye<br>
\end{document}<br>
<br>
Some comments/explanations:<br>
<br>
I put the graphics in a framebox just so you can see the boundary<br>
<br>
overpic takes all the same arguments as \includegrahpics, plus a few.<br>
<br>
The grid option shows you a grid so you can easily place things, and<br>
overpic scales a dimension to \unitlength, which makes it easy to place<br>
things, decide thicknesses, etc., in a reasonably robust way.<br>
<br>
I've drawn one line, colored white, to get you started. I guess your<br>
mask would have 4 lines and obviously you need to adjust the position,<br>
thickness, and orientation of each one to create the desired mask.<br>
<br>
pict2e enables you to draw lines of arbitrary thickness<br>
<br>
An alternative approach, if it is always the outer boundary of the image<br>
you want to clip, is simply to use the graphicx capability to clip your<br>
image or redefine the bounding box. If you wanted blank space around it,<br>
you could put it inside a picture environment that was sized bigger than<br>
your image.<br>
<br>
HTH<br>
Steve<br>
<font color="#888888"><br>
--<br>
+-------------------------------------------------------------------+<br>
Professor Steven J Schwartz        Phone: +44-(0)20-7594-7660<br>
Head, Space & Atmospheric Physics  Fax:   +44-(0)20-7594-7772<br>
The Blackett Laboratory            E-mail: <a href="mailto:s.schwartz@imperial.ac.uk">s.schwartz@imperial.ac.uk</a><br>
Imperial College London            Office: Huxley 6M67A<br>
London SW7 2AZ, U.K.               Web: <a href="http://www.sp.ph.ic.ac.uk/%7Esjs" target="_blank">www.sp.ph.ic.ac.uk/~sjs</a><br>
+-------------------------------------------------------------------+<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Best wishes,<br><br><br>