briatte / ggnetwork

Geoms to plot networks with ggplot2
https://briatte.github.io/ggnetwork/
146 stars 28 forks source link

get nodes to look like piecharts #76

Open Tristan-Philippe opened 3 months ago

Tristan-Philippe commented 3 months ago

Hi, great package! I want to include this kind of graph in my next paper, but would want to get more complexity across.

Is there a way to get the nodes to look like piecharts? Essentially make something like this: image

I don't have an example, just playing with the idea.

briatte commented 2 months ago

You would need to find a package that will draw pie charts instead of points, and then simply pass that geometry where you would pass geom_nodes in any of the examples shown in the vignette.

The standard (and discouraged) way of drawing pie charts in ggplot2 will not work, since they require adjusting the coordinates of the plot, which would warp the entire graph.