add bitmap graph style (TODO: documentation)
[PyX/mjg.git] / manual / epsfile.rst
blob7becc791b9b0595453e1464daf8912d9691eec9f
2 .. module:: epsfile
4 *****************************************
5 Module :mod:`epsfile`: EPS file inclusion
6 *****************************************
8 With the help of the ``epsfile.epsfile`` class, you can easily embed another EPS
9 file in your canvas, thereby scaling, aligning the content at discretion. The
10 most simple example looks like
12    ::
14       from pyx import *
15       c = canvas.canvas()
16       c.insert(epsfile.epsfile(0, 0, "file.eps"))
17       c.writeEPSfile("output")
20 All relevant parameters are passed to the ``epsfile.epsfile`` constructor. They
21 are summarized in the following table:
23 +---------------------+-----------------------------------------------+
24 | argument name       | description                                   |
25 +=====================+===============================================+
26 | ``x``               | :math:`x`\ -coordinate of position.           |
27 +---------------------+-----------------------------------------------+
28 | ``y``               | :math:`y`\ -coordinate of position.           |
29 +---------------------+-----------------------------------------------+
30 | ``filename``        | Name of the EPS file (including a possible    |
31 |                     | extension).                                   |
32 +---------------------+-----------------------------------------------+
33 | ``width=None``      | Desired width of EPS graphics or ``None`` for |
34 |                     | original width. Cannot be combined with scale |
35 |                     | specification.                                |
36 +---------------------+-----------------------------------------------+
37 | ``height=None``     | Desired height of EPS graphics or ``None``    |
38 |                     | for original height. Cannot be combined with  |
39 |                     | scale specification.                          |
40 +---------------------+-----------------------------------------------+
41 | ``scale=None``      | Scaling factor for EPS graphics or ``None``   |
42 |                     | for no scaling. Cannot be combined with width |
43 |                     | or height specification.                      |
44 +---------------------+-----------------------------------------------+
45 | ``align="bl"``      | Alignment of EPS graphics. The first          |
46 |                     | character specifies the vertical alignment:   |
47 |                     | ``b`` for bottom, ``c`` for center, and ``t`` |
48 |                     | for top. The second character fixes the       |
49 |                     | horizontal alignment: ``l`` for left, ``c``   |
50 |                     | for center ``r`` for right.                   |
51 +---------------------+-----------------------------------------------+
52 | ``clip=1``          | Clip to bounding box of EPS file?             |
53 +---------------------+-----------------------------------------------+
54 | ``translatebbox=1`` | Use lower left corner of bounding box of EPS  |
55 |                     | file? Set to :math:`0` with care.             |
56 +---------------------+-----------------------------------------------+
57 | ``bbox=None``       | If given, use ``bbox`` instance instead of    |
58 |                     | bounding box of EPS file.                     |
59 +---------------------+-----------------------------------------------+
60 | ``kpsearch=0``      | Search for file using the kpathsea library.   |
61 +---------------------+-----------------------------------------------+
63 .. _epsfile: