def plot2d(points, cells, mesh_color="<STR_LIT:k>", show_axes=False):
import matplotlib.pyplot as plt<EOL>from matplotlib.collections import LineCollection<EOL>fig = plt.figure()<EOL>ax = fig.gca()<EOL>plt.axis("<STR_LIT>")<EOL>if not show_axes:<EOL><INDENT>ax.set_axis_off()<EOL><DEDENT>xmin = numpy.amin(points[:, <NUM_LIT:0>])<EOL>xmax = numpy.amax(points[:, <NUM_LIT:0>])<EOL>ymin = numpy.amin(points[:, <NUM_LIT:1>])<EOL>ymax = numpy.amax(points[:, <NUM_LIT:1>])<EOL>width = xmax - xmin<EOL>xmin -= <NUM_LIT:0.1> * width<EOL>xmax += <NUM_LIT:0.1> * width<EOL>height = ymax - ymin<EOL>ymin -= <NUM_LIT:0.1> * height<EOL>ymax += <NUM_LIT:0.1> * height<EOL>ax.set_xlim(xmin, xmax)<EOL>ax.set_ylim(ymin, ymax)<EOL>edge_nodes, _ = create_edges(cells)<EOL>e = points[edge_nodes][:, :, :<NUM_LIT:2>]<EOL>line_segments = LineCollection(e, color=mesh_color)<EOL>ax.add_collection(line_segments)<EOL>return fig<EOL>
Plot a 2D mesh using matplotlib.