13

How do I increase the blue border line thickness? The stroke parameter is ignored in my example below.

library(tidyverse)
ggplot(mpg, aes(cty, hwy)) + 
  geom_col(color = "blue", stroke = 2)

2 Answers 2

17

Hopefully this works for you:

ggplot(mpg, aes(cty, hwy,fill="snow")) + 
  geom_bar(color = "navy",size=0.05,stat="identity",alpha=0.3)

The result: enter image description here

Then changing the size aesthetic:

ggplot(mpg, aes(cty, hwy,fill="snow")) + 
  geom_bar(color = "navy",size=2,stat="identity",alpha=0.3)

Yields this: enter image description here

3

geom_col does not have a stroke argument. Try this:

   library(tidyverse)
   ggplot(mpg, aes(cty, hwy)) + 
   geom_col(color = "blue", size = 2)
1
  • 1
    Answer still works but receives this warning message Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. Please use `linewidth` instead. Feb 28 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.