I would suggest next approach. You have to create a group and then use facets. Most of these tricks I learnt from @AllanCameron that has great answer for problems of this style.Next the code that can do that:
library(tidyverse)
#Data
df<-data.frame(animal=c("cat1","cat2","mouse1","mouse2","dog1","dog2"),
size=c(3,4,1,2,6,7),stringsAsFactors = F)
#Create group
df$Group <- gsub('\\d+','',df$animal)
#Now plot
ggplot(df,aes(x=animal,y=size))+
geom_col()+
facet_wrap(.~Group,scales = 'free', strip.position = "bottom")+
theme(strip.placement = "outside",
panel.spacing = unit(0, "points"),
strip.background = element_blank(),
strip.text = element_text(face = "bold", size = 12),
axis.text.x = element_blank(),
axis.ticks.x = element_blank())
The output:
