.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/grain_library_showcase.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_grain_library_showcase.py: Grain Library Demo ================== Demos selection of Grain geometries available within the library. .. GENERATED FROM PYTHON SOURCE LINES 7-23 .. image-sg:: /auto_examples/images/sphx_glr_grain_library_showcase_001.png :alt: grain library showcase :srcset: /auto_examples/images/sphx_glr_grain_library_showcase_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /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=',') | .. code-block:: Python 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() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.213 seconds) .. _sphx_glr_download_auto_examples_grain_library_showcase.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: grain_library_showcase.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: grain_library_showcase.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: grain_library_showcase.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_