I have some data around wind energy production in China. I'm visualising the data as a (circular) barplot, with the ultimate intention to make it I want to look like a windmill (yup I know this isn't great 'data analysis', just a bit of fun). How can I change the shape of the bars from their square form to look more like the blades on a turbine (ideally just through changing the shape of the bars, although I guess using a grob may be possible) Code and data for the circular bar plot:
data_clean <- structure(list(Type = c("Wind", "Wind", "Wind", "Wind", "Wind",
"Wind", "Wind", "Wind", "Wind", "Wind"), Year = c(2010, 2011,
2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019), Value_TWh = c(49.4,
74.1, 103, 138.3, 159.8, 185.6, 240.9, 303.4, 366, 405.7), id = 1:10,
film_year = c("Year: 2010 . Energy Output: 49.4", "Year: 2011 . Energy Output: 74.1",
"Year: 2012 . Energy Output: 103", "Year: 2013 . Energy Output: 138.3",
"Year: 2014 . Energy Output: 159.8", "Year: 2015 . Energy Output: 185.6",
"Year: 2016 . Energy Output: 240.9", "Year: 2017 . Energy Output: 303.4",
"Year: 2018 . Energy Output: 366", "Year: 2019 . Energy Output: 405.7"
)), class = c("spec_tbl_df", "tbl_df", "tbl", "data.frame"
), row.names = c(NA, -10L))
label_data <- data_clean
number_of_bar <- nrow(label_data)
angle <- 90 - 360 * (label_data$id-0.5) /number_of_bar
label_data$hjust<-ifelse( angle < -90, 1, 0)
label_data$angle<-ifelse(angle < -90, angle+180, angle)
data_clean %>%
ggplot(aes(x = Year, y = Value_TWh)) +
geom_bar(stat = "identity", fill = "grey", alpha = 0.7) +
ylim(-400,1200) +
theme_minimal() +
geom_text(aes(label=film_year),
hjust = label_data$hjust,
color = "black",
fontface = "bold",
alpha = 0.6,
size = 4,
angle = label_data$angle) +
coord_polar(start = 0) +
theme( axis.text = element_blank(),
axis.title = element_blank(),
panel.grid = element_blank(),
plot.margin = unit(rep(-1,4), "cm"))






