Created
May 7, 2019 11:13
-
-
Save krystophny/976931461205f9334a76e2c4f1808061 to your computer and use it in GitHub Desktop.
Plotting on a mesh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import matplotlib.tri as mpltri | |
import meshio # von https://github.com/nschloe/meshio | |
mesh = meshio.read('any_known_mesh_format.msh') | |
tria = mpltri.Triangulation(mesh.points[:,0], mesh.points[:,1], mesh.cells['triangle']) | |
for k in range(nplots): | |
plt.figure() | |
plt.tricontourf(tria, plot_data[k]) | |
plt.colorbar() | |
plt.savefig('fig_{:03}.pdf'.format(k)) | |
# wenn was interpoliert werden soll | |
datafun = mpltri.LinearTriInterpolator(tria, data_on_points) | |
wert = datafun(x, y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment