def plotDend(esd, filename=None):
"""Summary
Function to display an electrostatic similarity dendrogram from a
previously run ElecSimilarity class.
Parameters
----------
esd : ElecSimilarity class
ElecSimilarity class containing final esd matrix.
filename : str, optional
If the resulting plot should be written to disk, specify a filename.
Otherwise, the image will only be saved.
Returns
-------
None
Writes image to disk, if desired.
"""
# plt.style.use('seaborn-talk')
fig, ax = plt.subplots(sharey=True)
Z = cluster.linkage(esd.esd)
cluster.dendrogram(
Z,
labels=esd.ids,
leaf_rotation=90., # rotates the x axis labels
leaf_font_size=8., # font size for the x axis labels
ax=ax)
plt.xlabel('Variants')
plt.ylabel('ESD')
plt.tight_layout()
if filename is not None:
fig.savefig(filename)
评论列表
文章目录