Skip to content

Commit

Permalink
Double scale Bug in the dendrogram fixed (Caused by the new version o…
Browse files Browse the repository at this point in the history
…f matplotlib)
  • Loading branch information
tubiana committed Nov 5, 2021
1 parent c40bf2f commit ed7f8f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

MAJOR = 4
MINOR = 10
PATCH = 0
PATCH = 1
VERSION = "{}.{}.{}".format(MAJOR, MINOR, PATCH)

with open("ttclust/version.py", "w") as f:
Expand Down
6 changes: 2 additions & 4 deletions ttclust/ttclust.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def create_DM(traj, args):
# Extract the subpart.
traj_aligned = extract_selected_atoms(rmsd_string, traj_aligned, args["logname"])
# matrix initialization
distances = np.zeros((traj.n_frames, traj.n_frames))
distances = np.zeros((traj.n_frames, traj.n_frames),dtype=np.float32)

# Searching if a distance file already exist
distance_file = search_dist_mat(untouch_rmsd_string, args)
Expand Down Expand Up @@ -962,7 +962,7 @@ def plot_dendro(linkage, logname, cutoff, color_list, clusters_list):
STYLE = "classic"
if STYLE in plt.style.available:
plt.style.use(STYLE)
fig = plt.figure()
fig,ax = plt.subplots()
# Convert RGB color to HEX color
color_hex = [mpl.colors.rgb2hex(x) for x in color_list]
sch.set_link_color_palette(color_hex)
Expand All @@ -986,7 +986,6 @@ def plot_dendro(linkage, logname, cutoff, color_list, clusters_list):

# Graph parameters
plt.title("Clustering Dendrogram")
ax = plt.axes()
ax.set_xticklabels([])
plt.axhline(y=float(cutoff), color="grey") # cutoff value vertical line
ax.set_ylabel("Distance (AU)")
Expand Down Expand Up @@ -1292,7 +1291,6 @@ def define_LOGFILE(log):
global LOGFILE
LOGFILE = log


def main():
"""
Execute TTclust
Expand Down

0 comments on commit ed7f8f4

Please sign in to comment.