Skip to content

Commit 37b6f10

Browse files
committed
(#13) Resolve bug in diagnostic plotter
Ocassionally, the plotter crashes ...?
1 parent 35ad5ac commit 37b6f10

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pycsa/plotting/plotter.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,19 @@ def freq_panel(
157157
if self.cbar:
158158
self.fig.colorbar(im, ax=axs, fraction=0.2, pad=0.04, shrink=0.7)
159159

160-
m_j = np.arange(-nhj / 2 + 1, nhj / 2 + 1)
160+
m_j = np.arange(-nhj / 2 + 1, nhj / 2 + 1).astype(int)
161161
ylocs = np.arange(0.5, nhj + 0.5, 1.0)
162162

163-
m_i = np.arange(0, nhi)
163+
m_i = np.arange(0, nhi).astype(int)
164164
xlocs = np.arange(0.5, nhi + 0.5, 1.0)
165165

166166
axs.set_xticks(xlocs, m_i, rotation=-90)
167167
axs.set_yticks(ylocs, m_j)
168168
axs.set_title(title)
169169

170170
if self.set_label:
171-
axs.set_ylabel(r"$m$", fontsize=12)
172-
axs.set_xlabel(r"$n$", fontsize=12)
171+
axs.set_ylabel("m", fontsize=12, fontstyle='italic')
172+
axs.set_xlabel("n", fontsize=12, fontstyle='italic')
173173
# axs.set_aspect('equal')
174174

175175
# ref: https://stackoverflow.com/questions/20337664/cleanest-way-to-hide-every-nth-tick-label-in-matplotlib-colorbar
@@ -246,8 +246,8 @@ def fft_freq_panel(
246246
axs.set_title(title)
247247

248248
if self.set_label:
249-
axs.set_xlabel(r"$k$ [m$^{-1}$]", fontsize=12)
250-
axs.set_ylabel(r"$l$ [m$^{-1}$]", fontsize=12)
249+
axs.set_xlabel("k [1/m]", fontsize=12, fontstyle='italic')
250+
axs.set_ylabel("l [1/m]", fontsize=12, fontstyle='italic')
251251
if typ == "imag":
252252
axs.set_aspect("equal")
253253

0 commit comments

Comments
 (0)