Custom figsize
This commit is contained in:
parent
13c9a7901f
commit
95a5860e9a
2 changed files with 4 additions and 4 deletions
|
|
@ -4,11 +4,11 @@ from PIL.Image import Image
|
||||||
from math import ceil
|
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(
|
fig, axes = plt.subplots(
|
||||||
nrows=ceil(len(images) / images_per_row),
|
nrows=ceil(len(images) / images_per_row),
|
||||||
ncols=min(images_per_row, len(images)),
|
ncols=min(images_per_row, len(images)),
|
||||||
figsize=(24, 16),
|
figsize=figsize,
|
||||||
)
|
)
|
||||||
|
|
||||||
axes = axes.flatten()
|
axes = axes.flatten()
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import numpy as np
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
|
|
||||||
def plot_histograms_in_2d(histograms: Dict[str, np.ndarray]):
|
def plot_histograms_in_2d(histograms: Dict[str, np.ndarray], figsize=(15, 5)):
|
||||||
fig = plt.figure(figsize=(15, 5))
|
fig = plt.figure(figsize=figsize)
|
||||||
|
|
||||||
for i, (title, histogram) in enumerate(histograms.items(), 1):
|
for i, (title, histogram) in enumerate(histograms.items(), 1):
|
||||||
ax = fig.add_subplot(1, 3, i, projection="3d")
|
ax = fig.add_subplot(1, 3, i, projection="3d")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue