Data Visualization
viz1 = ggplot(df1, aes(fill = Network_Type , values = n)) +
geom_waffle(color = "white", size = 0.25,n_rows = 10, flip = TRUE) +
facet_wrap(~Financial_Condition, nrow = 1, strip.position = "bottom") +
scale_x_discrete() +
scale_y_continuous(labels = function(x) x * 10, # make this multiply the same as n_rows
expand = c(0,0))+
scale_fill_met_d("VanGogh2", direction=1)+
labs(title = "VanGogh2", x = "Financial Condition",
subtitle = " ",
caption = "")+
theme_minimal()+
theme(
axis.text.x = element_text(family = body_font, size=12),
axis.text.y = element_text(family = body_font, size=12),
# Legend
legend.position = "right",
legend.title = element_text(" "),
legend.spacing = unit(0.5, 'cm'),
legend.key.height= unit(0.5, 'cm'),
legend.key.width= unit(0.7, 'cm'),
legend.text = element_text(family = body_font,
size=13,
face = 'plain',
color = "grey10"),
# TITLE
plot.title.position = "plot",
plot.title = element_textbox(margin = margin(20, 0, 10, 0),
size = 15,
family = title_font,
face = "bold",
width = unit(55, "lines")),
# SUB-TITLE
plot.subtitle = element_text(margin = margin(10, 0, 20, 0),
size = 16,
family = body_font,
color = "grey15"),
# Caption
plot.caption.position = "plot",
plot.caption = element_text(family=body_font,
face="bold",
size=16,
color="grey40",
hjust=.5,
margin=margin(20,0,0,0)),
plot.background = element_rect(color="white", fill="white"),
plot.margin = margin(20, 40, 20, 40)
)
showtext_opts(dpi = 320)
ggsave(
"C:/Users/Hp/Desktop/IBK - TEMP/viz1.png",
)
## Saving 7 x 5 in image
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family '
## ' not found, will use 'sans' instead
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family ' ' not found, will use 'sans' instead
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family ' ' not found, will use 'sans' instead
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family ' ' not found, will use 'sans' instead
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family ' ' not found, will use 'sans' instead
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family ' ' not found, will use 'sans' instead
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family ' ' not found, will use 'sans' instead
showtext_auto(FALSE)
viz1
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## not found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## not found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database

viz2 <- ggplot(df2, aes(fill = Device, values = n)) +
geom_waffle(color = "white", size = 0.25, n_rows = 10, flip = TRUE) +
facet_wrap(~Adaptivity_Level, nrow = 1, strip.position = "bottom") +
scale_x_discrete() +
scale_y_continuous(labels = function(x) x * 10, # make this multiply the same as n_rows
expand = c(0,0))+
scale_fill_met_d("Homer1", direction=1)+
labs(title = "Homer1", x = "Adaptivity_Level",
subtitle = " ",
caption = " ")+
theme_minimal()+
theme(
axis.text.x = element_text(family = body_font, size=12),
axis.text.y = element_text(family = body_font, size=12),
# Legend
legend.position = "right",
legend.title = element_text(" "),
legend.spacing = unit(0.5, 'cm'),
legend.key.height= unit(0.5, 'cm'),
legend.key.width= unit(0.7, 'cm'),
legend.text = element_text(family = body_font,
size=13,
face = 'plain',
color = "grey10"),
# TITLE
plot.title.position = "plot",
plot.title = element_textbox(margin = margin(20, 0, 10, 0),
size = 15,
family = title_font,
face = "bold",
width = unit(55, "lines")),
# SUB-TITLE
plot.subtitle = element_text(margin = margin(10, 0, 20, 0),
size = 16,
family = body_font,
color = "grey15"),
# Caption
plot.caption.position = "plot",
plot.caption = element_text(family=body_font,
face="bold",
size=16,
color="grey40",
hjust=.5,
margin=margin(20,0,0,0)),
plot.background = element_rect(color="white", fill="white"),
plot.margin = margin(20, 40, 20, 40)
)
showtext_opts(dpi = 320)
ggsave(
"C:/Users/Hp/Desktop/IBK - TEMP/viz2.png",
dpi=320, width = 12, height = 9
)
showtext_auto(FALSE)
viz2
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database

viz3 <- ggplot(df3, aes(fill = Institution_Type, values = n)) +
geom_waffle(color = "white", size = 0.25, n_rows = 10, flip = TRUE) +
facet_wrap(~Education_Level, nrow = 1, strip.position = "bottom") +
scale_x_discrete() +
scale_y_continuous(labels = function(x) x * 10, # make this multiply the same as n_rows
expand = c(0,0))+
scale_fill_met_d("Hiroshige", direction=1)+
labs(title = "Hiroshige", x = "Education Level",
subtitle = "",caption = "")+
theme_minimal()+
theme(
axis.text.x = element_text(family = body_font, size=12),
axis.text.y = element_text(family = body_font, size=12),
# Legend
legend.position = "right",
legend.title = element_text(" "),
legend.spacing = unit(0.5, 'cm'),
legend.key.height= unit(0.5, 'cm'),
legend.key.width= unit(0.7, 'cm'),
legend.text = element_text(family = body_font,
size=13,
face = 'plain',
color = "grey10"),
# TITLE
plot.title.position = "plot",
plot.title = element_textbox(margin = margin(20, 0, 10, 0),
size = 15,
family = title_font,
face = "bold",
width = unit(55, "lines")),
# SUB-TITLE
plot.subtitle = element_text(margin = margin(10, 0, 20, 0),
size = 16,
family = body_font,
color = "grey15"),
# Caption
plot.caption.position = "plot",
plot.caption = element_text(family=body_font,
face="bold",
size=16,
color="grey40",
hjust=.5,
margin=margin(20,0,0,0)),
plot.background = element_rect(color="white", fill="white"),
plot.margin = margin(20, 40, 20, 40)
)
showtext_opts(dpi = 320)
ggsave(
"C:/Users/Hp/Desktop/IBK - TEMP/viz3.png",
dpi=320, width = 12, height = 9
)
showtext_auto(FALSE)
viz3
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database

viz4 <- ggplot(df4, aes(fill = Gender, values = n)) +
geom_waffle(color = "white", size = 0.25, n_rows = 10, flip = TRUE) +
facet_wrap(~IT_Student, nrow = 1, strip.position = "bottom") +
scale_x_discrete() +
scale_y_continuous(labels = function(x) x * 10, # make this multiply the same as n_rows
expand = c(0,0))+
scale_fill_met_d("Java", direction=1)+
labs(title = "Java", x = "IT Student",
subtitle = " ",
caption = "Graphic: Ibikunle Gabriel|Data Source: Don't doubt my data")+
theme_minimal()+
theme(
axis.text.x = element_text(family = body_font, size=12),
axis.text.y = element_text(family = body_font, size=12),
# Legend
legend.position = "right",
legend.title = element_text(""),
legend.spacing = unit(0.5, 'cm'),
legend.key.height= unit(0.5, 'cm'),
legend.key.width= unit(0.7, 'cm'),
legend.text = element_text(family = body_font,
size=13,
face = 'plain',
color = "grey10"),
# TITLE
plot.title.position = "plot",
plot.title = element_textbox(margin = margin(20, 0, 10, 0),
size = 15,
family = title_font,
face = "bold",
width = unit(55, "lines")),
# SUB-TITLE
plot.subtitle = element_text(margin = margin(10, 0, 20, 0),
size = 16,
family = body_font,
color = "grey15"),
# Caption
plot.caption.position = "plot",
plot.caption = element_text(family=body_font,
face="bold",
size=12,
color="grey40",
hjust=.5,
margin=margin(20,0,0,0)),
plot.background = element_rect(color="white", fill="white"),
plot.margin = margin(20, 40, 20, 40)
)
showtext_opts(dpi = 320)
ggsave(
"C:/Users/Hp/Desktop/IBK - TEMP/viz4.png",
dpi=320, width = 12, height = 9
)
showtext_auto(FALSE)
viz4
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database

combined <-
(viz1|viz2)/(viz3|viz4)
ggsave(
"C:/Users/Hp/Desktop/IBK - TEMP/combined.png",
dpi=320, width = 12, height = 9
)
combined
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
## Warning in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
## font family not found in Windows font database
