FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
solventmapcreator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yusuf Hamied Department of Chemistry
Hunter Group
SSIPtools
SSIMPLEapps
solventmapcreator
Commits
681c3f3f
Commit
681c3f3f
authored
7 years ago
by
M.D. Driver
Browse files
Options
Downloads
Patches
Plain Diff
continued on the dendrogram plotting methods.
parent
0c1a3aaf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
solventmapcreator/clusteringanalysis/dendrogramplotting.py
+28
-2
28 additions, 2 deletions
solventmapcreator/clusteringanalysis/dendrogramplotting.py
with
28 additions
and
2 deletions
solventmapcreator/clusteringanalysis/dendrogramplotting.py
+
28
−
2
View file @
681c3f3f
...
...
@@ -16,11 +16,37 @@ logging.basicConfig()
LOGGER
=
logging
.
getLogger
(
__name__
)
LOGGER
.
setLevel
(
logging
.
WARN
)
def
create_and_write_dendogram
(
linkage_matrix
,
labels
,
filename_stem
,
**
kwargs
):
"""
This creates a dendogram plot and writesto file.
"""
dendrogram_plot
,
dendrogram_plot_axis
=
create_dendogram
(
linkage_matrix
,
labels
,
kwargs
.
get
(
"
figsize
"
,(
15
,
20
)))
append_plot_labels
(
dendrogram_plot_axis
)
fileformat
=
kwargs
.
get
(
"
fileformat
"
,
"
eps
"
)
output_filename
=
create_outputfilename
(
filename_stem
,
fileformat
)
plt
.
savefig
(
output_filename
,
format
=
fileformat
)
plt
.
close
(
dendrogram_plot
)
return
0
def
create_outputfilename
(
filename_stem
,
fileformat
):
"""
This creates a
"""
return
plottinginput
.
create_output_filename_from_stem
(
filename_stem
,
fileformat
)
def
create_dendogram
(
linkage_matrix
,
labels
,
figsize
):
"""
Creates a
"""
Creates a
dendogram plot.
"""
dendrogram_plot
,
dendrogram_plot_axis
=
create_plot_with_axis
(
figsize
)
cluster
.
dendrogram
(
linkage_matrix
,
labels
=
labels
,
ax
=
dendrogram_plot_axis
)
cluster
.
dendrogram
(
linkage_matrix
,
labels
=
labels
,
leaf_rotation
=
90
,
leaf_font_size
=
8
,
ax
=
dendrogram_plot_axis
)
append_plot_labels
(
dendrogram_plot_axis
)
return
dendrogram_plot
,
dendrogram_plot_axis
def
append_plot_labels
(
plot_axis
):
"""
This adds labels to the dendrogram axis.
"""
plot_axis
.
set_xlabel
(
"
Solvent
"
)
plot_axis
.
set_ylabel
(
r
"
Distance/kJmol^{-1}
"
)
def
create_plot_with_axis
(
figsize
):
"""
Function creates plot and plot axis.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment