Skip to content

Commit 945ff0b

Browse files
psaveryZackAttack614
authored andcommitted
Fix miller indices display in pole figures
Recent changes to numpy would make the titles render like this: ```python np.int64(1), np.int64(1), np.int64(1) ``` Our conversion to an int before a string fixes them to be: ```python 1, 1, 1 ``` Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
1 parent 29efccf commit 945ff0b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hexrd/powder/wppf/texture.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,8 @@ def plot_pf(
12041204
pf = self.ax[nr][nc].tricontour(rho, r, I, levels=20, cmap=cmap)
12051205
self.ax[nr][nc].set_yticklabels([])
12061206
self.ax[nr][nc].grid(grid)
1207-
self.ax[nr][nc].set_title(f'({h})')
1207+
hkl_str = ', '.join(str(int(x)) for x in h)
1208+
self.ax[nr][nc].set_title(f'({hkl_str})')
12081209
plt.colorbar(pf, label=colorbar_label)
12091210

12101211
if show:
@@ -1305,7 +1306,8 @@ def update_new_pf_plots(self):
13051306

13061307
ax.set_yticklabels([])
13071308
ax.grid(grid)
1308-
ax.set_title(f'({h})')
1309+
hkl_str = ', '.join(str(int(x)) for x in h)
1310+
ax.set_title(f'({hkl_str})')
13091311
ax._plt_colorbar = self.fig_new.colorbar(pf, label=colorbar_label)
13101312

13111313
def calc_residual(self, params):

0 commit comments

Comments
 (0)