Originally, the name PyX was constructed as a combination of Postscript, i.e. the first output format supported by PyX, Python, i.e. the language in which PyX is written, and TeX, i.e. the program which PyX uses for typesetting purposes. Actually, the title of this question is a tribute to TeX because it is taken from the first chapter of the TeX book  where the origin of the name TeX and its pronunciation are explained.
Despite the ties between TeX and PyX, their pronunciation is quite different. According to the developers of PyX, it should be pronounced as [pʏks]. Please do not pronounce it as [pʏx] or [pʏç].
The current release of PyX (as well as older ones) is freely available from
http://pyx.sourceforge.net where also a
subversion repository with the latest patches can be found. In addition, PyX is
registered on the Python Package Index at
https://pypi.python.org/pypi/PyX and can
be installed by
pip. However, the release files are
not hosted on PyPI itself and for future versions of
pip you need to allow
external installation by
--allow-external pyx. Please see the
pip documentation for details.
Possibly older versions of PyX are also available as package for various Linux distributions: see, for instance, http://packages.debian.org/testing/python-pyx for information on the PyX package in Debian GNU/Linux or http://packages.ubuntu.com/raring/python-pyx for Ubuntu.
PyX has no dependencies on other Python packages.
Start a python session (usually by typing
python at the system prompt) and
then type the following two commands (
>>> is the python prompt)
>>> import pyx >>> pyx.__version__
Note that there are two underscores before and after
There are reasons which might make it necessary to use older versions of PyX.
If you are using Python 2 you will need PyX version 0.12.1 or earlier (see
Under which versions of Python will PyX run?). Furthermore, as at present it is not guaranteed
that PyX is backward compatible, it may be desirable to access an older version
of PyX instead of adapting older code to a more recent version of PyX. In order
to do that, one needs the corresponding PyX package (see
Where do I get the latest version of PyX? if you need to download it), which should be unpacked
below a directory, e.g.
/home/xyz/Python, where you want to keep the
various PyX versions. This will result in a subdirectory with a name like
PyX-0.14 which contains the contents of the corresponding package. You
can then ask Python to first look in the appropriate directory before looking
for the current version of PyX by inserting the following code (appropriately
modified according to your needs) at the beginning of your program before
importing the PyX module:
import sys sys.path.insert(0, "/home/xyz/Python/PyX-0.14")
Including appropriate lines even if the current version of PyX is used, might turn out to be helpful when the current version has become an old version (unless you have no difficulties determining the PyX version by looking at your code).
If your operating system supports path expansion, you might use as an alternative:
import sys, os sys.path.insert(0, os.path.expanduser("~/Python/PyX-0.14"))
which will expand the tilde to your home directory.
Yes, if you have installed Python (What is Python?) and TeX (What is TeX/LaTeX and why do I need it?). Both are available for a large variety of operating systems so chances are pretty good that you will get PyX to work on your system.
Starting with version 0.13, PyX requires Python 3.2 or higher. If you still need to run PyX with Python 2, you should use version 0.12.1 which is designed to run with Python 2.3 up to 2.7.
The version of your Python interpreter can be determined by calling it with the
-V. Alternatively, you can simply start the interpreter and take a
look at the startup message. Note that there may be different versions of
Python installed on your system at the same time. The default Python version
need not be the same for all users.
No, PyX itself does not provide a means to view the produced image. The result of a PyX run is an EPS (= Encapsulated PostScript) file, a PS (= PostScript) file, a PDF (= Portable Document Format) file or a SVG (= Scalable Vector Graphics) file, which can be viewed, printed or imported into other applications.
There are several means of viewing PS and EPS files. A common way would be to
ghostview which provides a user interface to the PostScript interpreter
ghostscript. More information about this software, which is available for a
variety of platforms, can be found at http://www.cs.wisc.edu/~ghost/. If you do not own a printer which is
capable of printing PostScript files directly,
ghostscript may also be
useful to translate PS and EPS files produced by PyX into something your
printer will understand.
PDF files can be viewed by means of the
Adobe Reader ® available from
http://www.adobe.com/products/acrobat/readstep2.html. On systems running
xpdf might be an alternative. It is available from
If you want to do interactive development of a PyX graphics, you might consider to use an IPython notebook (see Will I be able to embed PyX graphics output into an IPython notebook?).
Yes, PyX canvas object and objects inheriting from the canvas class, in particular
graphs and text, can be embedded into an IPython notebook. Suppose you have a
canvas object called
c on which you have done some drawing. Then entering
in an IPython notebook cell and executing that cell will automatically produce
a SVG representation and embed it into the notebook. (Alternatively, also PNG
is available by means of ghostscript, but the default display_order of IPython
prefers SVG over PNG.) For more information on IPython and working with its
notebooks see http://www.ipython.org/.
There exists a tutorial by Titus Winters which explains how to perform standard Gnuplot tasks with PyX. The tutorial can be found at http://www.cs.ucr.edu/~titus/pyxTutorial/.
The PyX sources contain a reference manual which is also available online at http://pyx.sourceforge.net/manual/. Furthermore, there exists a set of examples demonstrating various features of PyX, which is available in the sources or can be browsed at http://pyx.sourceforge.net/examples.html. If the feature you are looking for is among them, using the appropriate part of the example code or adapting it for your purposes may help.
There is also a user discussion list about PyX which you can subscribe to at http://lists.sourceforge.net/lists/listinfo/pyx-user. The archive of the discussion list is available at http://sourceforge.net/mailarchive/forum.php?forum_name=pyx-user.
Finally, it might be worth checking http://pyx.sourceforge.net/pyxfaq.pdf for an updated version of this FAQ.
|||D.Knuth, The TeX book (Addison-Wesley, 1984)|