-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
DOC: use notebook-style for plot_ward_structured_vs_unstructured.py #23228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: use notebook-style for plot_ward_structured_vs_unstructured.py #23228
Conversation
# ----------- | ||
# | ||
# Plotting the structured hierarchical clusters. | ||
|
||
fig = plt.figure() | ||
ax = fig.add_subplot(111, projection="3d", elev=7, azim=-80) | ||
ax.set_position([0, 0, 0.95, 1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title is not shown on the graph. Can you edit l.132 with
ax.set_title(f"With connectivity constraints (time {elapsed_time:.2f}s)")
@@ -72,14 +87,20 @@ | |||
) | |||
plt.title("Without connectivity constraints (time %.2fs)" % elapsed_time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plt.title("Without connectivity constraints (time %.2fs)" % elapsed_time) | |
ax.set_title(f"Without connectivity constraints (time {elapsed_time:.2f}s)") |
print("Elapsed time: %.2fs" % elapsed_time) | ||
print("Number of points: %i" % label.size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print("Elapsed time: %.2fs" % elapsed_time) | |
print("Number of points: %i" % label.size) | |
print(f"Elapsed time: {elapsed_time:.2f}s") | |
print(f"Number of points: {label.size}") |
print("Elapsed time: %.2fs" % elapsed_time) | ||
print("Number of points: %i" % label.size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print("Elapsed time: %.2fs" % elapsed_time) | |
print("Number of points: %i" % label.size) | |
print(f"Elapsed time: {elapsed_time:.2f}s") | |
print(f"Number of points: {label.size}") |
Hi @glemaitre, thanks for the follow up. I have made the changes that you have suggested. |
Thanks @krishnakoumar27 |
…cikit-learn#23228) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
…23228) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
Part of #22406
What does this implement/fix? Explain your changes.
Updated the example plot_ward_structured_vs_unstructured.py and added some comments for readability.
Any other comments?
Pleas let me know if there are any room for improvement.