Closed aisneto closed 1 year ago
Hi @aisneto, could you say more specifically what you want to do in this plot? Or, are you looking for more ideas of how to handle alluvial plots with small boxes that nevertheless need labels? I illustrate several options in one of the package vignettes, which you can view on the website here or run as follows:
vignette("labels", package = "ggalluvial")
Thank you for the indication, @corybrunson. The vignette was very helpful, and I believe the most adequate approach would be applying ggrepel. However, even after using this package, there is still some confusion around the text placement due to some strata being too small and having too many levels. Is there a way to adjust the minimum size for strata, or to add an space between each one?
To clarify, this chart aims to represent the frequency of methods employed for specific applications, and some of these methods were found to be employed in more than one application. Initially, I thought that an alluvial chart would be ideal to represent this relationship, but perhaps it is not? Are there any similar alternatives that you could suggest to express this relationship?
Hi @aisneto, i'm glad the vignette helps, and i can point you to a couple of other resources that might be useful to you.
First, see this example from the {ggrepel} site. The direction
parameter is useful for allowing labels to dodge each other vertically but remain rigidly positioned horizontally.
Second, if you're not concerned with representing totals along the vertical axis, then you might try the less rigid diagram family provided by {ggsankey}. The README on GitHub shows what you can do, though the syntax is significantly different from that of {ggalluvial}.
Let me know where you want to go from here, and i'll provide any more insight i can!
Thank you once again for your insights and attention, @corybrunson. I will be closing this, as the suggestions you kindly provided are sufficient to address my issue.
I am constructing an alluvial diagram to represent the frequency of paired discrete data. Everything went okay using ggplot and ggalluvial. However, in my end result, the text size does not quite fit the boxes created by geom_stratum. I am aware that I can change the text size to make it fit horizontally; however, the height of the boxes with a low count (n=1) is too small to fit any legible text. Making the font as small as these boxes would render the plot unreadable. The height of these boxes is defined by the size of alluvia that connects to them, and I can't find a way to expand those somehow. Could someone help me with this?
My code:
Result: