Skip to content

Commit

Permalink
Extracted sorting indices and sort the plot by them (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfir4444 committed Mar 28, 2023
2 parents ba4f5b9 + c31cd87 commit f0b66af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arc/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,9 @@ def plot_1d_rotor_scan(angles: Optional[Union[list, tuple, np.array]] = None,
marker_color, line_color = plt.cm.viridis([0.1, 0.9])
fig = plt.figure(figsize=(4, 3), dpi=120)
plt.subplot(1, 1, 1)
plt.plot(angles, energies, '.-', markerfacecolor=marker_color,
sort = np.argsort(angles)
plt.plot(np.array(angles)[sort], np.array(energies)[sort],
'.-', markerfacecolor=marker_color,
markeredgecolor=marker_color, color=line_color)
plt.xlabel('Dihedral angle increment (degrees)')
min_angle = int(np.ceil(min(angles) / 10.0)) * 10
Expand Down

0 comments on commit f0b66af

Please sign in to comment.