Update:
x-axis:
library(dplyr)
library(tibble)
my_matrix <- df %>%
column_to_rownames("cell_type") %>%
rename(Cells = Percentage) %>%
as.matrix()
my_Matrix <- apply(my_matrix, 2, cumsum)
my_Matrix <- my_Matrix - my_matrix / 2
par(mfrow = c(1, 3))
x <- barplot(my_matrix,
ylab = "Percentage",
col=c("red2", "green3", "slateblue4"),
border="white",
legend.text = rownames(my_matrix),
args.legend=list(cex=1,x = "topright"))
text(rep(x, each = nrow(my_Matrix)), my_Matrix, cex = 1.5, col = "white", labels = paste0(Percentage, "%"))

First answer:
Here is a base R barplot: as an alternative approach:
library(dplyr)
library(tibble)
my_matrix <- df %>%
column_to_rownames("cell_type") %>%
as.matrix()
my_Matrix <- apply(my_matrix, 2, cumsum)
my_Matrix <- my_Matrix - my_matrix / 2
par(mfrow = c(1, 3))
x <- barplot(my_matrix,
col=c("red2", "green3", "slateblue4"),
border="white",
# col = 1 + 1:nrow(my_matrix),
width = 0.5,
legend.text = rownames(my_matrix),
args.legend=list(cex=1,x = "topright"))
text(rep(x, each = nrow(my_Matrix)), my_Matrix, cex = 1.5, col = "white", labels = paste0(Percentage, "%"))
