next up previous contents index
Next: Example 2 Up: PyGist 2D Graphics Previous: PyGist 2D Graphics   Contents   Index


Example 1

In the first example we simply plot a straight line from (1, 0) to (2, 1). Note that only two coordinates are specified for y; x is not specified. In such a case, the values of x default to the integers from 1 to len (y).

from gist import *    # Put plot functions in name space. 
pldefault (marks = 1, width = 0, type = 1, style = "work.gs", 
           dpi = 100) # Set some defaults. 
winkill (0)           # Kill any existing window. 
window (0, wait = 1, dpi = 75) 
plg ([0, 1])          # The first positional argument is y.

1#1
The first positional argument in PLG is y.

As can be deduced from this example, most PyGist function calls can be augmented with a number of optional keyword arguments. These can (usually) be supplied in any order, and each is of the form keyword= value. Throughout this manual, a list of the available keywords for a function is given with the description of the function.



Michiel Jan Laurens de Hoon 2003-04-19