PyXGraph

PyX allows to generate publication quality postscript and pdf.
Convince yourself by looking at the examples.

PyX is extremely flexible and well designed, see the documentation (pdf and FAQ).

However, for slightly more complicated graphs the code can become very extensive. PyXgraph tries to address this by setting up some routines to make plotting simpler.

Presently the code is under heavy development, but still quite usable. Note that backwards compatibility might have to be broken in the future.

Download:

vers. 0.2.5: PyXGraph.zip, PyXGraph.tar.gz

Requirements

Examples

examples.ps.gz all examples in one file


To test all examples, just change to the examples directory and do
    ./run_all_examples 
or
    python make_html.py
And here is the result:

simple1.py

A simple example for the usage of pyxgraph and pyxplot
simple1.png

src eps

simple2_arangeplots.py

Arange two plots.
simple2_arangeplots.png

src eps

simple3_inset.py

Plot with inset

# FIXME: Getting the fonts smaller is a bit hackish at the moment ...
simple3_inset.png

src eps

simple4_arrows_labels.py

Arrows and labels.
simple4_arrows_labels.png

src eps

colors.py

Color sequence example
colors.png

src eps

colors1.py

Different ways of specifying colors
colors1.png

src eps

symbols.py

Showing off all symbols
symbols.png

src eps

styles_example.py

Different linestyles
styles_example.png

src eps

styles_example2.py

Additional attributes for lines.

Background:

Postscript has a command "setlinejoin" which selects either
mitred, rounded, or beveled corners.
http://www.capcode.de/help/setlinejoin
styles_example2.png

src eps

styles_example3.py

Linestyle definition with strings
styles_example3.png

src eps

axes1.py

semi-log plot
axes1.png

src eps

axes2.py

Double log plot and skipping of data
axes2.png

src eps

axes3.py

Plot with tick specification and smaller legend
axes3.png

src eps

axes4.py

Plot with x2axes and y2axes.
axes4.png

src eps

axes5.py

Plot with x2axis, y2axis removed.
axes5.png

src eps

axes6.py

Plot with no ticks on opposite sides.
axes6.png

src eps

axes7.py

piaxis example and background color
axes7.png

src eps

axes8.py

Key outside of the graph.

Contributed by Nikolai Hlubek.
axes8.png

src eps

axes9.py

Put axes labels slightly below the line of the x-tick labels.
and similarly for the y-axis.

Some prefer this style of labeling.
axes9.png

src eps

axes10.py

Outside ticks and other painter tricks.

FIXME: x2ticks and y2ticks don't work.
axes10.png

src eps

axes11.py

Plot without ticks and labels.
axes11.png

src eps

axes12.py

ticks and subticks
axes12.png

src eps

axes13.py

Plot without axes
axes13.png

src eps

axes14.py

linear plot, ticks in exponential notation
axes14.png

src eps

axes15.py

axis example with fractional numbers and background color
axes15.png

src eps

axes16.py

example for axis with ticks and without numbers
axes16.png

src eps

array1.py

Plot a two-dimensional error as bitmap.
array1.png

src eps

array2.py

Plot a two-dimensional error as bitmap and a colorbar.
array2.png

src eps

array3.py

Plot a two-dimensional error as bitmap and a colorbar, using segmented color mapper
array3.png

src eps

array4.py

Example for a contour plot.
array4.png

src eps

array5.py

Contour on top of bitmap plot, with labeling.
array5.png

src eps

histogram.py

Plot a histogram.
histogram.png

src eps

errorbars.py

Plot with errorbars
errorbars.png

src eps

bitmap1.py

A simple example for the inclusion of a bitmap.
bitmap1.png

src eps

bitmap2.py

A simple example for the inclusion of a bitmap.

Here the bitmpa is in front of the lines.
This is achieved using `go.dodata()`.
However,  because the graph is essentially finished,
it is not possible to plot any further lines
after this which would be in front of the bitmap.
bitmap2.png

src eps

bitmap3.py

A simple example for the inclusion of a bitmap.

   Keep the aspect ratio of the original bitmap.
bitmap3.png

src eps

bitmap4.py

A simple example for the inclusion of a bitmap.

   Keep the aspect ratio of the original bitmap.
bitmap4.png

src eps

matplotlib_pyx.py

Combine matplotlib and pyxgraph

   Matplotlib does a fantastic job for bitmapped graphics,
   including anti-aliasing and transparency.
   Because transparency is not supported in Postscript
   it can be useful to create a bitmapped figure using matplotlib
   and embed it in PyX to do the labeling.
matplotlib_pyx.png

src eps

make_arrows.py

Some arrow tricks...
make_arrows.png

src eps

make_labels_with_arrows.py

Labels with arrows
make_labels_with_arrows.png

src eps

amsmath_and_xscale.py

Demonstrate the usage of amsmath specific features and overall scaling.
amsmath_and_xscale.png

src eps

sans_serif_fonts.py

Demonstrate the usage sans-serif fonts.

To use this you will have to get the file sfmath.sty
and put it somewhere, where latex can find it
(eg the same directory or into some directory which
is in the TEXINPUTS path)

Getting the file::

  wget http://dtrx.de/od/tex/archive/sfmath.sty.v0.7
  mv sfmath.sty.v0.7 sfmath.sty

See: http://dtrx.de/od/tex/sfmath.html by Olaf Dietrich <olaf@dtrx.de>
sans_serif_fonts.png

src eps

sans_serif_fonts2.py

Demonstrate the usage sans-serif fonts with cmbright.

Remarks:
- Debian etch package needed for this:
    aptitude install texlive-fonts-extra
    aptitude install cm-super
  (not sure whether the last one is really needed, but why not ;-)
- Good references on Mathematics fonts in LaTeX
  http://cg.scs.carleton.ca/~luc/math.html
  ftp://ctan.cms.math.ca/tex-archive/documentation/Free_Math_Font_Survey/en/survey.html
sans_serif_fonts2.png

src eps

filled_regions.py

Stroking and filling of regions
filled_regions.png

src eps

colorbars.py

Different colorbars.
colorbars.png

src eps

plot_3d_1.py

3d example 1
plot_3d_1.png

src eps

plot_3d_2.py

3d example 2
plot_3d_2.png

src eps


Valid HTML 4.01 Valid CSS! Last modified: 25 October 2007, 12:24:22
Impressum, © Arnd Bäcker