Custom figsize

This commit is contained in:
Andras Schmelczer 2024-06-14 21:27:00 +01:00
parent 13c9a7901f
commit 95a5860e9a
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 4 additions and 4 deletions

View file

@ -4,11 +4,11 @@ from PIL.Image import Image
from math import ceil
def display_images(images: Dict[str, Image], images_per_row: int = 3):
def display_images(images: Dict[str, Image], images_per_row: int = 3, figsize=(24, 16)):
fig, axes = plt.subplots(
nrows=ceil(len(images) / images_per_row),
ncols=min(images_per_row, len(images)),
figsize=(24, 16),
figsize=figsize,
)
axes = axes.flatten()

View file

@ -4,8 +4,8 @@ import numpy as np
from typing import Dict
def plot_histograms_in_2d(histograms: Dict[str, np.ndarray]):
fig = plt.figure(figsize=(15, 5))
def plot_histograms_in_2d(histograms: Dict[str, np.ndarray], figsize=(15, 5)):
fig = plt.figure(figsize=figsize)
for i, (title, histogram) in enumerate(histograms.items(), 1):
ax = fig.add_subplot(1, 3, i, projection="3d")