Home > Net >  Replace barplot axis labels with plots in R?
Replace barplot axis labels with plots in R?

Time:03-27

A while ago I asked barplot with plots on x-axis

Now, if I add in the line bp coordflip() while creating the barplot and continue with the rest of the code, the barplot is flipped, but the individual plots remain in place, like so: flipped barplot

I'm guessing I need to alter the p_axis part of the code to fix the individual plots where A, B, C are shown in the above plot... but im not sure exactly what to do to fix this? I tried experimenting but have been unsuccessful so far.

CodePudding user response:

A simpler approach at this point is to use the ggExtra package, which has a function ggMarginal() that adds these plots with your choice of geom.

See example

  • Related