biggles

libplot python module

A Python module for the libplot plotting library, part of the GNU plotutils package.

download

You'll need the following: (note that the rpms are for redhat-6.2/python-1.5.2)

  1. GNU plotutils 2.4.1 [ .tar.gz, .rh71.i386.rpm, .rh62.i386.rpm ]
  2. libplot module 1.0.2 [ .tar.gz, .rh71.i386.rpm, .rh62.i386.rpm ]

example

For more information see the plotutils manual's section on libplot.


#!/usr/bin/env python

import libplot
import Numeric

# defaults to X window plot
pl = libplot.Plotter()

pl.openpl()
pl.erase()
pl.fspace( -50, -50, 50, 50 )

# draw bounding box
pl.box( -50, -50, 50, 50 )

x = Numeric.arange( -40, 40, 0.5 )
y = Numeric.sin(x/6) * 30

def plot_curve( pl, x, y ):
	pl.fmove( x[0], y[0] )
	for i in range( 1, len(x) ):
		pl.fcont( x[i], y[i] )

# draw red sine wave
pl.pencolorname( "red" )
plot_curve( pl, x, y )

pl.closepl()



( home : last modified Oct 12 2001 ) SourceForge Logo