Skip to content

Commit

Permalink
Improvements in plotting for multiphase structures
Browse files Browse the repository at this point in the history
  • Loading branch information
AHartmaier committed Aug 6, 2024
1 parent a69b73b commit b7886d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/kanapy/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def plot_voxels_3D(data, Ngr=1, sliced=False, dual_phase=False,
Ngr = 2
else:
Ngr = np.max(data)
if np.min(data) == 0:
Ngr += 1
if clist is None:
cm = plt.cm.get_cmap(cmap, Ngr)
colors = cm(data.astype(int))
Expand All @@ -100,6 +102,8 @@ def plot_voxels_3D(data, Ngr=1, sliced=False, dual_phase=False,
if igr > 0:
ind = np.where(grl == igr)[0]
colors[i, j, k, 0:3] = clist[ind[0]]
else:
colors[i, j, k, 0:3] = [0.3, 0.3, 0.3]

if sliced:
ix = int(Nx / 2)
Expand Down

0 comments on commit b7886d3

Please sign in to comment.