Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

ggplot2 - remove top border

$
0
0

I'm want to remove only the top part of my graph. I found some directions here and here. However, they remove all the borders or the top and left. I know that I should probably use the argument panel.border with element_blank() or element_rect() but I cannot find the correct way to define it.

I'm looking for this:

enter image description here

library(tidyverse)

mtcars %>% 
  ggplot(aes(factor(cyl), disp)) + 
  geom_boxplot() + 
  jtools::theme_apa() + 
  theme(
    panel.border = element_blank())

Will results with:

enter image description here


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>