Skip to content

Conversation

@krishnakoumar27
Copy link
Contributor

@krishnakoumar27 krishnakoumar27 commented Apr 27, 2022

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.


fig = plt.figure()
ax = fig.add_subplot(111, projection="3d", elev=7, azim=-80)
ax.set_position([0, 0, 0.95, 1])
Copy link
Member

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)")

s=20,
edgecolor="k",
)
plt.title("Without connectivity constraints (time %.2fs)" % elapsed_time)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
plt.title("Without connectivity constraints (time %.2fs)" % elapsed_time)
ax.set_title(f"Without connectivity constraints (time {elapsed_time:.2f}s)")

Comment on lines 111 to 112
print("Elapsed time: %.2fs" % elapsed_time)
print("Number of points: %i" % label.size)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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}")

Comment on lines 66 to 67
print("Elapsed time: %.2fs" % elapsed_time)
print("Number of points: %i" % label.size)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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}")

@lesteve lesteve added the Quick Review For PRs that are quick to review label Apr 29, 2022
@lesteve lesteve mentioned this pull request Apr 29, 2022
47 tasks
@krishnakoumar27
Copy link
Contributor Author

Hi @glemaitre, thanks for the follow up. I have made the changes that you have suggested.

@glemaitre glemaitre merged commit 920ab25 into scikit-learn:main May 1, 2022
@glemaitre
Copy link
Member

Thanks @krishnakoumar27

glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request May 19, 2022
glemaitre added a commit that referenced this pull request May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Quick Review For PRs that are quick to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants