From ed7f8f4a5f1172fbc47c72c488953aa6921d29f5 Mon Sep 17 00:00:00 2001 From: thibault Date: Fri, 5 Nov 2021 11:17:46 +0100 Subject: [PATCH] Double scale Bug in the dendrogram fixed (Caused by the new version of matplotlib) --- setup.py | 2 +- ttclust/ttclust.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 6be529c..d866879 100644 --- a/setup.py +++ b/setup.py @@ -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: diff --git a/ttclust/ttclust.py b/ttclust/ttclust.py index 1af4fd2..994c778 100644 --- a/ttclust/ttclust.py +++ b/ttclust/ttclust.py @@ -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) @@ -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) @@ -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)") @@ -1292,7 +1291,6 @@ def define_LOGFILE(log): global LOGFILE LOGFILE = log - def main(): """ Execute TTclust