Changeset 4851
- Timestamp:
- Nov 22, 2007, 3:24:09 PM (17 years ago)
- 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 973 973 974 974 975 from anuga.utilities.polygon import plot_polygons 975 from anuga.utilities.polygon import plot_polygons_points 976 976 977 977 # First do the continuous version of mesh -
anuga_core/source/anuga/fit_interpolate/interpolate.py
r4845 r4851 555 555 msg += '%d: %s\n' %(i, interpolation_points[i]) 556 556 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 557 564 # Joaquim Luis suggested this as an Exception, so 558 565 # that the user can now what the problem is rather than … … 564 571 565 572 # Plot boundary and interpolation points 566 # FIXME (Jane): Here's a beginning towards plotting567 573 if verbose is True: 568 574 from anuga.utilities.polygon import plot_polygons_points -
anuga_core/source/anuga/utilities/polygon.py
r4845 r4851 341 341 return abs(poly_area/2) 342 342 343 def plot_polygons_points(polygons_points, style=None, figname=None, label=None, verbose=False): 343 def plot_polygons_points(polygons_points, style=None, 344 figname=None, label=None, verbose=False): 344 345 345 346 """ Take list of polygons and plot. … … 350 351 351 352 style - style list corresponding to each polygon 353 - for a polygon, use 'line' 354 - for points falling outside a polygon, use 'outside' 352 355 353 356 figname - name to save figure to … … 377 380 378 381 n = len(polygons_points) 382 colour = [] 379 383 if style is None: 380 384 style_type = 'line' … … 382 386 for i in range(n): 383 387 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 385 398 for i, item in enumerate(polygons_points): 386 399 x, y = poly_xy(item) … … 389 402 if min(y) < miny: miny = min(y) 390 403 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]) 395 405 xlabel('x') 396 406 ylabel('y')
Note: See TracChangeset
for help on using the changeset viewer.