Skip to content

Commit bc997e7

Browse files
authored
Fix/aplot index error (#1691)
* Avoiding error * Using max * Avoiding coverage issues
1 parent 70c6b3b commit bc997e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ansys/mapdl/core/mapdl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,9 +1566,10 @@ def aplot(
15661566

15671567
# individual surface isolation is quite slow, so just
15681568
# color individual areas
1569-
if color_areas:
1569+
if color_areas: # pragma: no cover
15701570
anum = surf["entity_num"]
1571-
rand = np.random.random(anum[-1] + 1)
1571+
size_ = max(anum) + 1
1572+
rand = np.random.random(size_)
15721573
area_color = rand[anum]
15731574
meshes.append({"mesh": surf, "scalars": area_color})
15741575
else:

0 commit comments

Comments
 (0)