Skip to content

Commit 17536d4

Browse files
committed
Bug fix in plot subset (0 to 1 based indexing)
1 parent 79fc72b commit 17536d4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cpex/lattice.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ def plot(self, y='stress', x='frame', idx=1, alpha=0.2):
5555
def plot_subset(self, grain_list, y='stress', x='frame', idx=1, alpha=0.2,
5656
random=None):
5757

58+
5859
if random != None:
5960
grain_list = np.random.choice(self.num_grains, random)
61+
else:
62+
grain_list = [i-1 for i in grain_list]
6063

6164
dy = {'strain':self.e[:,grain_list],
6265
'stress':self.s[:,grain_list],

0 commit comments

Comments
 (0)