set.seed
(5642)
sample_data1 <-
data.frame
(name=
c
(
"Geek1"
,
"Geek2"
,
"Geek3"
,
"Geek4"
,
"Geeek5"
) ,
value=
c
(31,12,15,28,45))
sample_data2 <-
data.frame
(x =
rnorm
(400))
sample_data3 <-
data.frame
(name=
c
(
"C++"
,
"C#"
,
"Java"
,
"R"
,
"Python"
) ,
value=
c
(301,112,115,228,145))
library
(
"ggplot2"
)
library
(
"gridExtra"
)
plot1<-
ggplot
(sample_data1,
aes
(x=name, y=value))+
geom_segment
(
aes
(x=name, xend=name, y=0, yend=value), color=
"grey"
) +
geom_point
( color=
"green"
, size=4)
plot2<-
ggplot
(sample_data2,
aes
(x = x)) +
geom_density
(fill=
"#69b3a2"
, color=
"#e9ecef"
, alpha=0.8)
plot3<-
ggplot
(sample_data3,
aes
(x=name, y=value)) +
geom_bar
(fill=
"#69b3a2"
, stat =
"identity"
)
grid.arrange
(plot1, plot2,plot3, ncol= 3)