We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2343d58 commit c643f20Copy full SHA for c643f20
1 file changed
foolbox/plot.py
@@ -13,8 +13,10 @@ def images(
13
nrows: Optional[int] = None,
14
figsize: Optional[Tuple[float, float]] = None,
15
scale: float = 1,
16
+ labels: Any = None,
17
+ return_fig: bool = False,
18
**kwargs: Any,
-) -> None:
19
+) -> Optional[Tuple[Any, Any]]:
20
import matplotlib.pyplot as plt
21
22
x: ep.Tensor = ep.astensor(images)
@@ -57,7 +59,7 @@ def images(
57
59
nrows=nrows,
58
60
figsize=figsize,
61
squeeze=False,
- constrained_layout=True,
62
+ constrained_layout=False,
63
**kwargs,
64
)
65
@@ -68,5 +70,10 @@ def images(
68
70
ax.set_yticks([])
69
71
ax.axis("off")
72
i = row * ncols + col
73
+ if labels is not None:
74
+ ax.set_title(labels[i])
75
if i < len(x):
76
ax.imshow(x[i])
77
+
78
+ if return_fig:
79
+ return fig, axes
0 commit comments