Skip to content

Commit dd2de6e

Browse files
authored
fix(abacus-plot): fix reshape parameter and PDOS plotting issues (#7455)
- Remove invalid 'newshape' keyword from np.reshape() call - Remove unnecessary reassignment of dosplot.ax after _plot() calls Fixes #6864
1 parent d0e0915 commit dd2de6e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • tools/plot-tools/abacus_plot

tools/plot-tools/abacus_plot/dos.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def _read(self):
248248
orb['data'] = np.asarray(data, dtype=float)
249249
self.orbitals.append(orb)
250250

251-
self.energy = np.reshape(e_list, newshape=(-1, 1)).astype(float)
251+
self.energy = np.reshape(e_list, (-1, 1)).astype(float)
252252

253253
def _all_sum(self) -> Tuple[np.ndarray, int]:
254254
res = np.zeros_like(self.orbitals[0]["data"], dtype=float)
@@ -423,9 +423,9 @@ def _parial_plot(self,
423423
dosplot.plot_params["xlabel_params"])
424424
else:
425425
dosplot.ax.set_xlabel("Energy(eV)", size=25)
426-
dosplot.ax = self._plot(dosplot, energy_f, tdos, "TDOS")
426+
self._plot(dosplot, energy_f, tdos, "TDOS")
427427
for elem in dos.keys():
428-
dosplot.ax = self._plot(dosplot, energy_f, dos[elem], elem)
428+
self._plot(dosplot, energy_f, dos[elem], elem)
429429
if "notes" in dosplot.plot_params.keys():
430430
dosplot._set_figure(energy_range, dos_range,
431431
notes=dosplot.plot_params["notes"])

0 commit comments

Comments
 (0)