font_family = "ParaType"
font_face = 'bold'
background_color = "#fcf3e4"
grid_color = "#ccc2a2"
y_breaks = [100, 200]
y_breaks_data = {
"x": ["JAN"] * len(y_breaks),
"y": y_breaks,
"text": [str(b) for b in y_breaks],
}
ggplot(df, aes(as_discrete("Month", levels=list(angles.keys())), "Sunshine hours")) + \
geom_text(aes("x", "y", label="text"), data=y_breaks_data, \
angle=-shift, family=font_family, fontface=font_face, size=6, vjust=0) + \
geom_bar(stat='identity', color="black", fill="#fbc117", \
tooltips=layer_tooltips().title("@City").line("@Month: @{Sunshine hours}")) + \
geom_label(aes("Month", label="Month", angle="Angle"), y=330, \
family=font_family, fontface=font_face, size=8, \
label_padding=0, label_r=0, label_size=0, fill=background_color) + \
facet_wrap(facets="City", order=None) + \
coord_polar(start=pi*shift/180) + \
labs(title="Comparing Sunshine Hours", \
caption="Sunshine duration is expressed in (average) hours per month\n"
"Data source: https://www.kaggle.com/datasets/bilalwaseer/sunshine-hours-for-cities-around-the-world\n"
"Original plot: https://www.linkedin.com/feed/update/urn:li:activity:7186216546602524672/") + \
ggsize(1000, 850) + \
theme(axis='blank', \
plot_title=element_text(size=32, family=font_family, face=font_face, margin=[20, 20, 30]), \
plot_caption=element_text(family=font_family, face=font_face), \
strip_text=element_text(size=20, family=font_family, face=font_face), \
plot_background=element_rect(fill=background_color), \
panel_grid=element_line(color=grid_color, size=2))