Search code examples
rggplot2cowplot

Is it possible to suppress label cowplot package R


I was wondering if it is possible to suppress the axis label at (x - top: "mpg") and (y - right: "wt") using the package cowplot.

library(ggplot2); library(cowplot)  
plot_a <- ggplot(mtcars, aes(mpg,wt)) + geom_point()  
ggdraw(switch_axis_position(plot_a, axis = 'xy',keep = 'xy'))

Thanks!

enter image description here


Solution

  • See here: https://rdrr.io/cran/cowplot/man/panel_border.html

    Substitute your ggdraw line for: plot+panel_border(colour="black", size=0.5, linetype=1,remove=FALSE)