1

I am trying to plot 2 categorical variables using ggplot2's geom_point geometry. In order to avoid overlapping I found the solution of jittering the points, but that is not really pretty nor easy to comprehend.

I searched some questions here and some github discussions and came across this package, ggpointgrid, which works great with it's geom_pointrect geometry. The problem then came from plotly's ggplotly not allowing the custom geometry to be used.

Searching even more, I found this solution on the RStudio community forum. Which works great with ggplotly. I don't fully understand what goes on in the code and was wondering if it would be possible to modify it to order the points by colour (if it is present).

If this is difficult to achieve and there is a solution to use ggpointgrid with ggplotly that I missed, that would also be great!

Any hints or directions are also really appreciated!

Thanks in advance.

aaa
  • 63
  • 3

0 Answers0