def plot_mesh(self):
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
fig = plt.figure()
ax = fig.add_subplot(111)
_x,_y = [],[]
patches = []
for k,elm in enumerate(self.ec):
_x,_y,_ux,_uy = [],[],[],[]
for nd in elm:
_x.append(self.nc[nd,0])
_y.append(self.nc[nd,1])
polygon = Polygon(zip(_x,_y), True)
patches.append(polygon)
pc = PatchCollection(patches, color="#25CDCD", edgecolor="#435959", alpha=0.8, lw=0.5)
ax.add_collection(pc)
x0,x1,y0,y1 = self._rect_region()
ax.set_xlim(x0,x1)
ax.set_ylim(y0,y1)
#~ ax.set_title("Model %s"%(self.name))
ax.set_aspect("equal")
plt.show()
评论列表
文章目录