Note
Go to the end to download the full example code.
Grain Library Demo
Demos selection of Grain geometries available within the library.

/home/runner/work/PySALESetup/PySALESetup/PySALESetup/objects.py:197: UserWarning: genfromtxt: Empty input file: "/home/runner/work/PySALESetup/PySALESetup/PySALESetup/grain_library_directory/__init__.py"
coords = np.genfromtxt(file_name, delimiter=',')
from PySALESetup import GrainLibrary
import matplotlib.pyplot as plt
grain_library = GrainLibrary()
grain_library.load_builtin_library()
fig = plt.figure()
for i in range(1, 25+1):
ax = fig.add_subplot(5, 5, i)
grain = grain_library.random_grain()
grain.plot(ax)
fig.tight_layout()
plt.show()
Total running time of the script: (0 minutes 1.213 seconds)