I have the following code:
library(ggplot2)
data(mtcars)
ggplot(mtcars, aes(x=mpg)) + geom_histogram(bins=15, colour='red')
Which produce this:
As stated there, how can I change the thickness of the enclosing line of the histogram?
I have the following code:
library(ggplot2)
data(mtcars)
ggplot(mtcars, aes(x=mpg)) + geom_histogram(bins=15, colour='red')
Which produce this:
As stated there, how can I change the thickness of the enclosing line of the histogram?
Just use size
argument
geom_histogram(bins=15, colour='red',size=2)
Easy enough :)
ggplot(mtcars, aes(x=mpg)) + geom_histogram(bins=15, colour='red',size=3)
In addition, to program in point space, I used the following function:
MyPoints <- function(desired_points){
return (unit(desired_points*.5*(1/1.07), "point"))
}
geom_histogram(size=MyPoints(1))
Just tested on ggplot2, the size
aesthetic for lines was deprecated in ggplot2 version 3.4.0.
You can do the same using linewidth
.
ggplot(mtcars, aes(x=mpg)) +
geom_histogram(bins=15, colour='red', linewidth=0.2)
© 2022 - 2024 — McMap. All rights reserved.
size=3
– Cleanshaven