set.seed(123)df<-tibble( group =letters[1:5], value =round(runif(5,min =10,max =100),digits =0))df%>%ggplot(mapping =aes(x =group, y =value, fill =group))+geom_col()
x_hex<-0.5+0.5*cos(seq(2*pi/4, by =2*pi/6, length.out =6))y_hex<-0.5+0.5*sin(seq(2*pi/4, by =2*pi/6, length.out =6))grid::grid.newpage()wave_sine<-grid.pattern_wave(x_hex, y_hex, colour ="black", type ="sine", fill =c("red", "blue"), density =0.4, spacing =0.15, angle =0, amplitude =0.05, frequency =1/0.20)
Show the code
# zig-zag pattern is a wave of "type = triangle"grid::grid.newpage()wave_triangle<-grid.pattern_wave(x_hex, y_hex, colour ="black", type ="triangle", fill =c("red", "blue"), density =0.4, spacing =0.15, angle =0, amplitude =0.075)