transformation example
[PyX/mjg.git] / manual / epsfile.tex
blobad1bf144c1007256facd93bd0eb56c06629d30bd
1 \chapter{Module epsfile: EPS file inclusion}
3 With help of the \verb|epsfile.epsfile| class, you can easily embed
4 another EPS file in your canvas, thereby scaling, aligning the content
5 at discretion. The most simple example looks like
6 \begin{quote}
7 \begin{verbatim}
8 from pyx import *
9 c = canvas.canvas()
10 c.insert(epsfile.epsfile("file.eps"))
11 c.writetofile("output")
12 \end{verbatim}
13 \end{quote}
15 All relevant parameters are passed to the \verb|epsfile.epsfile|
16 constructor. They are summarized in the following table:
18 \medskip
19 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
20 argument name&description\\
21 \hline
22 \texttt{filename} & Name of the EPS file (including a possible
23 extension).\\
24 \texttt{x="0 t m"} & $x$-coordinate of position (converts to user
25 unit by default).\\
26 \texttt{y="0 t m"} & $y$-coordinate of position (converts to user
27 unit by default).\\
28 \texttt{width=None} & Desired width of EPS graphics or \texttt{None}
29 for original width. Cannot be combined with scale specification.\\
30 \texttt{heigth=None} & Desired height of EPS graphics or \texttt{None}
31 for original height. Cannot be combined with scale specification.\\
32 \texttt{scale=None} & Scaling factor for EPS graphics or \texttt{None}
33 for no scaling. Cannot be combined with width or height specification.\\
34 \texttt{align="bl"} & Alignment of EPS graphics. The first character
35 specifies the vertical alignment: \texttt{b} for bottom, \texttt{c}
36 for center, and \texttt{t} for top. The second character fixes the
37 horizontal alignment: \texttt{l} for left, \texttt{c} for center
38 \texttt{r} for right.\\
39 \texttt{clip=1} & Clip to bounding box of EPS file?\\
40 \texttt{showbbox=0} & Stroke bounding box of EPS file?\\
41 \texttt{translatebox=1} & Use lower left corner of bounding box of EPS
42 file? Set to $0$ with care.
43 \end{tabularx}
47 \label{epsfile}
49 %%% Local Variables:
50 %%% mode: latex
51 %%% TeX-master: "manual.tex"
52 %%% End: