Changeset 4851


Ignore:
Timestamp:
Nov 22, 2007, 3:24:09 PM (17 years ago)
Author:
sexton
Message:

minor update

Location:
anuga_core/source/anuga
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/test_neighbour_mesh.py

    r4836 r4851  
    973973
    974974
    975         from anuga.utilities.polygon import plot_polygons
     975        from anuga.utilities.polygon import plot_polygons_points
    976976
    977977        # First do the continuous version of mesh
  • anuga_core/source/anuga/fit_interpolate/interpolate.py

    r4845 r4851  
    555555                    msg += '%d: %s\n' %(i, interpolation_points[i])
    556556
     557                #from anuga.utilities.polygon import plot_polygons_points
     558                #in_interp_pts =
     559                #out_interp_pts = take(interpolation_points,[indices])
     560                #title = 'Interpolation points fall outside specified mesh'
     561                #plot_polygons_points([mesh_boundary_polygon,in_interp_pts,out_interp_pts],
     562                #                     ['line','point','outside'],label=title,verbose=verbose)
     563
    557564                # Joaquim Luis suggested this as an Exception, so
    558565                # that the user can now what the problem is rather than
     
    564571
    565572            # Plot boundary and interpolation points
    566             # FIXME (Jane): Here's a beginning towards plotting
    567573            if verbose is True:
    568574                from anuga.utilities.polygon import plot_polygons_points
  • anuga_core/source/anuga/utilities/polygon.py

    r4845 r4851  
    341341    return abs(poly_area/2)
    342342
    343 def plot_polygons_points(polygons_points, style=None, figname=None, label=None, verbose=False):
     343def plot_polygons_points(polygons_points, style=None,
     344                         figname=None, label=None, verbose=False):
    344345   
    345346    """ Take list of polygons and plot.
     
    350351
    351352    style            - style list corresponding to each polygon
     353                     - for a polygon, use 'line'
     354                     - for points falling outside a polygon, use 'outside'
    352355                       
    353356    figname          - name to save figure to
     
    377380   
    378381    n = len(polygons_points)
     382    colour = []
    379383    if style is None:
    380384        style_type = 'line'
     
    382386        for i in range(n):
    383387            style.append(style_type)
    384        
     388            colour.append('b-')
     389    else:
     390        for s in style:
     391            if s == 'line':
     392                colour.append('b-')           
     393            if s == 'outside':
     394                colour.append('r.')
     395            else:
     396                colour.append('g.')
     397           
    385398    for i, item in enumerate(polygons_points):
    386399        x, y = poly_xy(item) 
     
    389402        if min(y) < miny: miny = min(y)
    390403        if max(y) > maxy: maxy = max(y)
    391         if style[i] is 'line':
    392             plot(x,y,'b-')
    393         else:
    394             plot(x,y,'r.')
     404        plot(x,y,colour[i])
    395405        xlabel('x')
    396406        ylabel('y')
Note: See TracChangeset for help on using the changeset viewer.