'''DISTorX project v2.3Lech Stanislaw Kalinowski 2017'''import numpy as npimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dprint ("\n>>DISTorX Structure Visualization<<\n")FileName = input("Please enter File Name: ")XYZ = np.genfromtxt(FileName, dtype=("S10",'float16', 'float16', 'float16'))xs,ys,zs = [],[],[]fig = plt.figure(figsize=(10,10))ax = fig.add_subplot(2,2,1, projection='3d')ax.set_title('Perspective View')bx = fig.add_subplot(2,2,2)bx.set_title('View along Z axis')cx = fig.add_subplot(2,2,3)cx.set_title('View along X axis')dx = fig.add_subplot(2,2,4)dx.set_title('View along Y axis')for i in range(len(XYZ)): xs.append(XYZ[i][1]) ys.append(XYZ[i][2]) zs.append(XYZ[i][3])#print xs,ys,zsax.scatter(xs, ys, zs, c = None, depthshade=True)bx.scatter(xs, ys)cx.scatter(ys, zs)dx.scatter(xs, zs)ax.set_xlabel('a')ax.set_ylabel('b')ax.set_zlabel('c')plt.show()>>DISTorX Structure Visualization<<Please enter File Name: CeRuSnIn [4]:
'''DISTorX project v2.3Lech Stanislaw Kalinowski 2017'''from vpython import *import numpy as npimport matplotlib.pyplot as pltball = []FileName = input("Please enter File Name: ")XYZ = np.genfromtxt(FileName, dtype=("S10",'float16', 'float16', 'float16'))Elements = np.genfromtxt('Elements', dtype=("int16", "S10", "S10", 'float16', 'float16', 'float16', 'float16'))cl = (0,0,0)R = 0.05scene.autocenter = Truescene = canvas(title='>>DistorX Structure Visualisation<<', x=0, y=0, center = vec(0.5,0.5,0.5),\ width=800, height=800, background=vec(1,1,1))for i in range (len(XYZ)): for j in range (len(Elements)): if XYZ[i][0] == Elements[j][1]: cl = vec(Elements[j][4],Elements[j][5],Elements[j][6]) R = Elements[j][3]/3 ball.append(sphere(pos=vec(XYZ[i][1],XYZ[i][2], XYZ[i][3]), radius = (R), color = cl))Please enter File Name: CeRuSnIn [ ]: