Graphical#
The classes in the graphical package.
from disorder.graphical.canvas import Canvas
from disorder.graphical.plots import Line
x = np.linspace(0,1,16)
y = np.sin(2*np.pi*x)
X = np.linspace(0,1,128)
Y = np.cos(2*np.pi*X)
canvas = Canvas()
line = Line(canvas)
line.plot_data(x, y, marker='o', label=r'$\sin(2 \pi x)$')
line.plot_data(X, Y, marker='-', label=r'$\cos(2 \pi x)$')
line.set_labels(r'$y=f(x)$', r'$x$', r'$y$')
line.show_legend()
canvas.close()
from disorder.graphical.visualization import CrystalStructure
from disorder.material import structure
uc = structure.UnitCell('H2O.cif', tol=1e-4)
xyz = uc.get_unit_cell_cartesian_atomic_coordinates()
occ = uc.get_occupancies()
U = uc.get_cartesian_anisotropic_displacement_parameters()
mxmymz = uc.get_cartesian_magnetic_moments()
A = uc.get_fractional_cartesian_transform()
atms = uc.get_unit_cell_atoms()
colors = uc.get_atom_colors()
radii = uc.get_atom_radii()
cs = CrystalStructure(A, *xyz, atms, colors, 1, 1, 1)
cs.draw_cell_edges()
cs.draw_basis_vectors()
cs.atomic_radii(radii, occ)
# cs.atomic_displacement_ellipsoids(*U, p=1.0)
# cs.magnetic_vectors(*mxmymz)
cs.view_direction(3, 2, 1)
cs.show_figure()