Skip to content
Snippets Groups Projects
Commit 0dd13871 authored by fima's avatar fima :beers:
Browse files

supressing warning

parent 8bf13bc0
No related branches found
No related tags found
1 merge request!124Viz add colorbar
This commit is part of merge request !124. Comments created here will be created in the context of that merge request.
......@@ -3,6 +3,8 @@ Provides a collection of visualization functions.
"""
import math
import warnings
from typing import List, Optional, Union
import dask.array as da
......@@ -130,6 +132,7 @@ def slices(
figsize=(ncols * img_height, nrows * img_width),
constrained_layout=True,
)
if nrows == 1:
axs = [axs] # Convert to a list for uniformity
......@@ -192,6 +195,8 @@ def slices(
ax.axis("off")
if cbar:
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=UserWarning)
fig.tight_layout()
norm = matplotlib.colors.Normalize(vmin=new_vmin, vmax=new_vmax, clip=True)
mappable = matplotlib.cm.ScalarMappable(norm=norm, cmap=cmap)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment