Module pygplot
[show private | hide private]
[frames | no frames]

Module pygplot

Pygplot: A Python Interface to Pgplot

Version: 0.91

Author: Chris Burns

Requires:

Pgplot (http://www.astro.caltech.edu/~tjp/pgplot/)

You can get the source for pygplot here: http://astro.swarthmore.edu/~burns/pygplot_downloads.

There is the beginnings of a manual here: http://astro.swarthmore.edu/~burns/pygplot.pdf.

This python module provides an object-oriented interface to the Pgplot library of routines. Most (though not all) of the functionality of Pgplot is included:
  1. 1-D plots using lines, symbols and error-bars
  2. 2-D plots using color (or gray-scale) images and contours
  3. Access to all the pgplot primitives through the ppgplot extension module.

Classes
MPlot Class used to create a multi-panel plot with separate bounding boxes.
Panel Class used to create a multi-panel plot with a single bounding box.
Plot Class to make a single 2-D plot.
_Axis A class used by the Plot class.
_ColorPoint Class used to display (x,y) points (like _Point), but each point is colored differently, depending on the value of a third array (z).
_Contour Class used to plot a contour of data.
_ErrorBar A class used by the Plot class to store information about drawing errorbars
_Hist Class used by Plot to make a Histogram.
_Image Class used to display an image representation of data.
_Label A class used by the Plot class.
_Legend A class used by the Plot class to make a legend.
_Line Class used by Plot and to store information about lines.
_Palette  
_Point Class used by Plot to store information about drawing points.

Function Summary
  columns(filename)
Read in the specified file and try to extract columns.
  Linear(low, high, n)
Convenience function for computing n numbers linearly interpolated between low and high.
  list_devices()
Print out the list of available devices.
  list_palettes()
Print the currently installed palettes to the terminal.
  pgspline(xp, yp, x, slope0, slope1)
Compute the cubic spline for a set of data
  _evspline(xp, x, c0, c1, c2, c3)
  _scalerange(data)
Adjust the range to be plotted so that it fits nicely on the page.
  _set_color(color)
  _spline(x, c0, c1, c2, c3)

Variable Summary
dict descriptions = {'/NULL': ['(Null device, no output)', 0]...
list devices = ['/GIF', '/VGIF', '/NULL', '/PPM', '/VPPM', '/...
int n_devices = 15                                                                    
dict _color_table = {'Blue': 4, 'Pink': 13, 'Green3': 10, 'Gr...
str _default_clab_color = 'white'
int _default_clab_int = 40                                                                    
int _default_clab_min = 10                                                                    
str _default_color = 'white'
int _default_font = 1                                                                     
float _default_fsize = 1.0                                                                   
int _default_linestyle = 1                                                                     
int _default_linewidth = 1                                                                     
int _default_lw = 2                                                                     
str _default_palette = 'real'
int _default_symbol = 1                                                                     
str _default_transfer = 'linear'
_Palette _pgpalette = <pygplot._Palette instance at 0x880f444>

Function Details

columns(filename)

Read in the specified file and try to extract columns. So far, it will recognise space-, comma-, tab-, or semi-colon-delimited columns.
Parameters:
filename - the name of the file to read
           (type=string)
Returns:
a 2-D array: one row for each column in the file

Linear(low, high, n)

Convenience function for computing n numbers linearly interpolated between low and high. Used as the default function for the cfunc parameter to the contour function.

list_devices()

Print out the list of available devices.

list_palettes()

Print the currently installed palettes to the terminal.

pgspline(xp, yp, x, slope0=None, slope1=None)

Compute the cubic spline for a set of data
Parameters:
xp - An array of x-coordinates for the control points.
           (type=float array)
yp - An array of y-coordinates for the control points.
           (type=float array)
x - An array of x-coordinates where you want interpolations to be done
           (type=float array)
slope0 - Optionally specify the slope at the beginning of the interval
           (type=float)
slope1 - Optionally specify the slope at the end of the interval
           (type=float)

_scalerange(data)

Adjust the range to be plotted so that it fits nicely on the page. Return a list with adjusted minimum and maximum values from 'data'.

Variable Details

descriptions

Type:
dict
Value:
{'/CPS': ['(Colour PostScript file, landscape orientation)', 0],
 '/GIF': ['(Graphics Interchange Format file, landscape orientation)',\
 0],
 '/NULL': ['(Null device, no output)', 0],
 '/PPM': ['(Portable Pixel Map file, landscape orientation)', 0],
 '/PS': ['(PostScript file, landscape orientation)', 0],
 '/VCPS': ['(Colour PostScript file, portrait orientation)', 0],
 '/VGIF': ['(Graphics Interchange Format file, portrait orientation)',\
...                                                                    

devices

Type:
list
Value:
['/GIF', '/VGIF', '/NULL', '/PPM', '/VPPM', '/PS', '/VPS', '/CPS', '/V\
CPS']                                                                  

n_devices

Type:
int
Value:
15                                                                    

_color_table

Type:
dict
Value:
{'BLACK': 0,
 'BLUE': 4,
 'BLUE2': 11,
 'Black': 0,
 'Blue': 4,
 'Blue2': 14,
 'CYAN': 5,
 'Cyan': 5,
...                                                                    

_default_clab_color

Type:
str
Value:
'white'                                                                

_default_clab_int

Type:
int
Value:
40                                                                    

_default_clab_min

Type:
int
Value:
10                                                                    

_default_color

Type:
str
Value:
'white'                                                                

_default_font

Type:
int
Value:
1                                                                     

_default_fsize

Type:
float
Value:
1.0                                                                   

_default_linestyle

Type:
int
Value:
1                                                                     

_default_linewidth

Type:
int
Value:
1                                                                     

_default_lw

Type:
int
Value:
2                                                                     

_default_palette

Type:
str
Value:
'real'                                                                 

_default_symbol

Type:
int
Value:
1                                                                     

_default_transfer

Type:
str
Value:
'linear'                                                               

_pgpalette

Type:
_Palette
Value:
<pygplot._Palette instance at 0x880f444>                               

Generated by Epydoc 2.1 on Thu Feb 17 15:17:27 2005 http://epydoc.sf.net