Could someone help me with a hint to plot these vervet monkey behavioral data? Here are the codes and my expectation.
I want to plot vervet monkeys and I got stuck.
males<-c(21,50,25,12,15,1,5)
females<-c(20,30,22,12,16,46,8)
activities<- c("playing", "grooming", "dancing", "feeding", "mating", "fighting", "eating")
Vervet<-data.frame(activities,females, males)
Vervet |>
pivot_longer(females:males, values_to = "Count", names_to = "Gender") |>
ggplot(mapping = aes(x= activities , y= Count, fill= Gender))+ geom_col(position = "dodge")+
scale_fill_continuous()+
coord_flip()+
theme_bw()+
theme(panel.grid = element_blank())
And here are my expectation graph.



scale_fill_continuous()+(and optionally removecoord_flip()+) and you'll end up with a plot that looks almost identical to your expected graph.... + scale_fill_discrete(name = NULL)to remove the legend name. Optionally+ labs(x = "Activities")(or up-case the original frame's column name). You can includetheme(..., axis.line = element_line(arrow=arrow(type="closed")), panel.border = element_blank())to change the axis lines. Similarly you can change theaxis.ticksas desired.