Skip to content

Commit b7886d3

Browse files
committed
Improvements in plotting for multiphase structures
1 parent a69b73b commit b7886d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/kanapy/plotting.py

+4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def plot_voxels_3D(data, Ngr=1, sliced=False, dual_phase=False,
8585
Ngr = 2
8686
else:
8787
Ngr = np.max(data)
88+
if np.min(data) == 0:
89+
Ngr += 1
8890
if clist is None:
8991
cm = plt.cm.get_cmap(cmap, Ngr)
9092
colors = cm(data.astype(int))
@@ -100,6 +102,8 @@ def plot_voxels_3D(data, Ngr=1, sliced=False, dual_phase=False,
100102
if igr > 0:
101103
ind = np.where(grl == igr)[0]
102104
colors[i, j, k, 0:3] = clist[ind[0]]
105+
else:
106+
colors[i, j, k, 0:3] = [0.3, 0.3, 0.3]
103107

104108
if sliced:
105109
ix = int(Nx / 2)

0 commit comments

Comments
 (0)