Skip to content
Snippets Groups Projects

Viz add colorbar

Merged s214743 requested to merge viz-add-colorbar into main
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
+ 7
2
@@ -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
@@ -191,8 +194,10 @@ def slices(
# Hide the axis, so that we have a nice grid
ax.axis("off")
if cbar:
fig.tight_layout()
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)
Loading