This is a follow up question to this one: Addressing just the outermost cells in a raster? In this question you can find all the code and the data.
I have a DEM raster masked to the outlines of some glaciers. The raster is cut into three different masks: glacier-adjacent cells (outside the glacier), glacier margin cells (glacier border cells) und inner glacier cells. I used the code provided by @obrl_soil to cut the raster and it worked.
However, when I plot the three results simultaneously, I get this result (see picture below). It seems to me, that every class has a slightly different opinion on what there elevation is. Is this just a plotting error that I overlooked or is there something wrong with the code?