The code works fine up until the plot. The problem with the plot is that there are spaces between each column and I don't want that. To better understand what I am trying to do, I want to make a depth-percent plot where on the y axis I have sand-silt-clay(%) Below I enclose an image of the histogram, as well as the code I used to create it. I hope that the image can be displayed (I used the upload function of the Rstudio community, I don't know how to upload an image).
library(readxl)
setwd("C:/Users/30693/Desktop/Μεταπτυχιακό 2019-2021/Διπλωματική 2019-2021/Διπλωματική 2019-2021 Λουσοί/Dionisis")
Lousoi_SM=readxl::read_xlsx("Lousoi SM.xlsx")
library(ggplot2)
library(tidyr)
library(dplyr)
mgroup=group_by(Lousoi_SM,Mean)
msum=summarise(mgroup,Sand,Silt,Clay)
msum_long=pivot_longer(msum,col=2:4)
ggplot()+
geom_histogram(data =msum_long,aes(x=Mean,y=value,fill=name),
stat = "identity")