0

enter image description here

I am quit new to python, tried to search in the documentations to draw 2D mesh (a filled rectangle ) using vertices/nodes values at each point as shown in fig attached? I have tried many ideas but all failed, as the following:

from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = Axes3D(fig, auto_add_to_figure=False)
fig.add_axes(ax)
coord = [0,25,25,0]
coord_y = [.06,.6,.1,.125]
z = [0,0,0,0]
connectivity=np.array([[0,3,4,1],[1,4,5,2]])
verts = [list(zip(coord,coord_y,z))]
ax.add_collection3d(Poly3DCollection(verts))
plt.show()
talonmies
  • 70,661
  • 34
  • 192
  • 269
msci
  • 89
  • 6
  • Does this answer your qn ? https://stackoverflow.com/questions/52202014/how-can-i-plot-2d-fem-results-using-matplotlib – httpanand Dec 06 '21 at 14:30
  • @httpanand Thank you for your comment, I have had a look on the mentioned post earlier, however, it's not written how to add connectivity number o the figure as I attached o my question, Thank you again – msci Dec 06 '21 at 14:46

0 Answers0