Changeset 319

Show
Ignore:
Timestamp:
11/11/08 12:32:37 (2 months ago)
Author:
bruederle
Message:

inserted some examples into plotting docstrings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/plotting.py

    r318 r319  
    7575    Inputs: 
    7676        progress - a float between 0. and 1. 
     77         
     78    Example: 
     79        >> progress_bar(0.7) 
     80            |===================================               | 
    7781    """ 
    7882    progressConditionStr = "ERROR: The argument of function NeuroTools.plotting.progress_bar(...) must be a float between 0. and 1.!" 
     
    126130        xmin, xmax  - the limits of the x axis 
    127131        ymin, ymax  - the limits of the y axis 
     132         
     133    Example: 
     134        >> x = range(10) 
     135        >> y = [] 
     136        >> for i in x: y.append(i*i) 
     137        >> pylab.plot(x,y) 
     138        >> plotting.set_axis_limits(pylab, 0., 10., 0., 100.) 
    128139    """ 
    129140    if hasattr(subplot, 'xlim'): 
     
    146157        xlabel  - a string for the x label 
    147158        ylabel  - a string for the y label 
     159         
     160    Example: 
     161        >> x = range(10) 
     162        >> y = [] 
     163        >> for i in x: y.append(i*i) 
     164        >> pylab.plot(x,y) 
     165        >> plotting.set_labels(pylab, 'x', 'y=x^2') 
    148166    """ 
    149167    if hasattr(subplot, 'xlabel'): 
     
    192210        mat      - a 2D numpy array of floats between 0 and 1 
    193211        filename - string specifying the filename where to save the data, has to end on '.png' 
     212     
     213    Example: 
     214        >> import numpy 
     215        >> a = numpy.random.random([100,100]) # creates a 2D numpy array with random values between 0. and 1. 
     216        >> save_2D_image(a,'randomarray100x100.png') 
    194217    """ 
    195218    assert PILIMAGEUSE, "ERROR: Since PIL has not been detected, the function NeuroTools.plotting.save_2D_image(...) is not supported!" 
     
    215238        filename       - string specifying the filename where to save the data, has to end on '.zip' 
    216239        frame_duration - specifier for the duration per frame, will be stored as additional meta-data 
     240         
     241    Example: 
     242        >> import numpy 
     243        >> framelist = [] 
     244        >> for i in range(100): framelist.append(numpy.random.random([100,100])) # creates a list of 2D numpy arrays with random values between 0. and 1. 
     245        >> save_2D_movie(framelist, 'randommovie100x100x100.zip', 0.1) 
    217246    """ 
    218247    try: