def plot_img_list(data: list, titles: list = None):
    """
    Plot image list in notebook.

    Args:
        data (`list`):
            All the dataset.
        titles (`list`):
            Title list of the image to show.
    """
    if len(data) == 1:
        return plot_img(data[0], titles)
    _, axs = plt.subplots(1, len(data), figsize=(5 * len(data), 5 * len(data)))
    for ax, i in zip(axs, range(len(data))):
        img = data[i]
        if isinstance(img, Union[str, PosixPath].__args__):
            img = from_src(img)
        try:
            ax.imshow(img.to_ndarray())
        except: # pylint: disable=bare-except
            ax.imshow(to_image_color(img, 'RGB'))
        ax.axis('off')
        if titles and titles[i]:
            ax.set_title(f'{titles[i]:.04f}\n')
Plot image list in notebook.

Args:
data (`list`):
All the dataset.
titles (`list`):
Title list of the image to show.
towhee/utils/matplotlib_utils.py