diff --git a/meshmode/mesh/visualization.py b/meshmode/mesh/visualization.py index 8966861b168f5d740a099e5ec4ad80baccdba4b0..15c539409ec006dcc4d0591ccd61f7952b270547 100644 --- a/meshmode/mesh/visualization.py +++ b/meshmode/mesh/visualization.py @@ -30,7 +30,7 @@ import numpy as np # {{{ draw_2d_mesh def draw_2d_mesh(mesh, draw_vertex_numbers=True, draw_element_numbers=True, - draw_connectivity=False, **kwargs): + draw_connectivity=False, set_bounding_box=False, **kwargs): assert mesh.ambient_dim == 2 import matplotlib.pyplot as pt @@ -110,6 +110,12 @@ def draw_2d_mesh(mesh, draw_vertex_numbers=True, draw_element_numbers=True, length_includes_head=True, color="green", head_width=1e-2, lw=1e-2) + if set_bounding_box: + from meshmode.mesh.processing import find_bounding_box + lower, upper = find_bounding_box(mesh) + pt.xlim([lower[0], upper[0]]) + pt.ylim([lower[1], upper[1]]) + # }}} # vim: foldmethod=marker