Skip to content
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

Group Visualization #7

Open
Luo624 opened this issue Jan 10, 2024 · 5 comments
Open

Group Visualization #7

Luo624 opened this issue Jan 10, 2024 · 5 comments

Comments

@Luo624
Copy link

Luo624 commented Jan 10, 2024

Hello, I am very interested in your work.
I would like to know how it is done in the group visualization piece and what is the name of the graph, I would like to try to plot it but I don't know the name of the graph.
cgi-bin_mmwebwx-bin_webwxgetmsgimg_ MsgID=908891790643046299 skey=@crypt_9876ca9_6e71b062e702241b7520f3d617c3a30b mmweb_appid=wx_webfilehelper

@InhwanBae
Copy link
Owner

Hi, @Luo624!

I used a convex hull algorithm to group the members into regions for visualization. I hope the code snippet below is helpful to you.

from scipy.spatial import ConvexHull
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon

plt.figure()
r, theta = 16, np.arange(0, 32, 1) / 32 * 2 * np.pi
circle_points = np.column_stack([r * np.cos(theta), r * np.sin(theta)])
group_member = points[indices == group_idx]
group_circle_points = np.concatenate([circle_points + member for member in group_member], axis=0)
hull = ConvexHull(group_circle_points)
point = group_circle_points[hull.vertices]
p = Polygon(point, facecolor='#DCE3E9', edgecolor='#23445D', linewidth=3, zorder=-hull.area)
plt.gca().add_patch(p)

@Luo624
Copy link
Author

Luo624 commented Jan 11, 2024

Hi, InhwanBae!
Thanks for your reply, I think I know how to realize.

@chenxi-xr
Copy link

Hi, InhwanBae!
I don't know how to define some of the variables in the above code snippet, can you please publish the complete group visualization code? Thank you very much!!

@Pradur241
Copy link

@Luo624 Hi, have you realize the visualization of group? Can you please share the code? Thank you very much!!

@Luo624
Copy link
Author

Luo624 commented Feb 25, 2024

@Pradur241
You can refer to the author's reply above, trust me, it's not hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants