Actually, I believe he just gave exactly contradicting answers on Guillaume's question. As I get it, this is what the result should look like:
I did it with the following code, however, I have no idea why a more straight-forward way didn't work (maybe someone can tell me?):
So the idea is to create another axes above the ones showing the image and plot the mean of the grayscale there. For some reason (please help) I have to draw the plot somewhere else first and then copy it to the axes where it's shown finally. When I plot directly in the axes on top of the ones with the image, the image axes will be deleted - I have no idea why.
What I mean is the following:
>> figure, imshow(img)