matbench_genmetrics.core.utils namespace
Submodules
matbench_genmetrics.core.utils.featurize module
matbench_genmetrics.core.utils.match module
matbench_genmetrics.core.utils.plotting module
- matbench_genmetrics.core.utils.plotting.plot_images(images, nrows, ncols, seed=10, formula_as_title=True)[source]
This function plots a list of images. If the number of images is greater than the number of subplots, it randomly selects a subset of images to plot.
- Parameters:
images (List[np.ndarray]) – List of images to be plotted. Each image is a numpy array.
nrows (int) – Number of rows in the subplot grid.
ncols (int) – Number of columns in the subplot grid.
seed (int, optional) – Seed for the random number generator, by default 10.
formula_as_title (bool, optional) – If True, the reduced formula of the structure corresponding to the image is used as the title of the subplot, by default True.
- Returns:
A tuple containing the matplotlib Figure object and an array of Axes objects.
- Return type:
Tuple[plt.Figure, np.ndarray]
- matbench_genmetrics.core.utils.plotting.plot_structures_2d(structures, nrows, ncols, seed=10, formula_as_title=True)[source]
This function plots 2D representations of a list of pymatgen Structure objects. If the number of structures is greater than the number of subplots, it randomly selects a subset of structures to plot.
- Parameters:
structures (List[Structure]) – List of pymatgen Structure objects to be plotted.
nrows (int) – Number of rows in the subplot grid.
ncols (int) – Number of columns in the subplot grid.
seed (int, optional) – Seed for the random number generator, by default 10.
formula_as_title (bool, optional) – If True, the reduced formula of the structure is used as the title of the subplot, by default True.
- Returns:
A tuple containing the matplotlib Figure object and an array of Axes objects.
- Return type:
Tuple[plt.Figure, np.ndarray]