ggplot2: how to change the width of colour aesthetic in a bar/col geometry?

Matifou

I am making a column/barplot, where I change the fill aesthetic (inner colour of bar) with one variable, and the colour aesthetic (colour around the bar) with another variable. The colour around the bar is not easy to see, so I would like to increase the width of that bar. How can I do that? I don't see any width argument in scale_color_manual?

library(ggplot2)

dat <- data.frame(x = 1:5, y = 1:5, p = 1:5, q = factor(1:5),
                  r = factor(1:5))
data <-  data_frame(x = rep("a", 4),
                    y = c(1,2,4,3),
                    categ = c("1", "2", "3", "4"),
                    group = rep(c("a", "b"), each=2))

ggplot(data, aes(x, y, fill= categ, colour=group)) + 
  geom_col() +
  scale_color_manual(values = c("red", "blue")) 

Thanks!

enter image description here

KoenV

You may use the size argument

ggplot(data, aes(x, y, fill= categ, colour=group)) + 
  geom_col(size=3) +   ### change
  scale_color_manual(values = c("red", "blue")) 

yielding this:

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

dissociate colour from group in aesthetic mapping in ggplot2

How to change background colour of legend in ggplot2?

How to change the text in the colour legend of ggplot2

How to change colour for barplot in ggplot2 using viridis package?

How to change the order of fill aesthetic in faceted ggplot?

How to change the order of aesthetic layers in ggplot?

Different colour palettes for two different colour aesthetic mappings in ggplot2

How to change the colour of the lines in ggplot

R ggplot2: manually set fill colour without "fill" aesthetic?

How to simulate passing an aesthetic to panel background in ggplot2?

How to increase bounds of a continuous aesthetic in ggplot2

How to change legend title and key order and colour to a multi-stacked barplot in R with ggplot2

How to change the colour for missing value in geom_point of ggplot2?

How to change colour and position of geom_text for just one bar in a barplot in ggplot2 (R)?

ggplot2: geom_bar fill colour; how to change to different grouping of data

How to change line width and colour in R? And add a title?

How to change font size and colour directlabels in ggplot

Optional aesthetic in ggplot2

Is it possible to change the colour of legend elements in ggplot2?

ggplot2 - Change `geom_rect` colour in a stacked barplot

R ggplot2: change colour of font and background in facet strip?

Conditionally change background colour of line plot in ggplot2

How to increase aesthetic qualities of ggplot?

ggplot2 change fill for color legend when fill also used in aesthetic

ggplot2 - how to fill nested polygons with colour?

How to adjust legend for a colour-shape combiation in ggplot2?

How to customise the colour for middle and maximum value in ggplot2?

How to add a ggplot2 subtitle with different size and colour?

How to segregate by one factor but colour by another in ggplot2 R?