Why, in supply and demand curves, does price go on the y-axis?
As @KennyLJ points out I think the reason is partly historical. However it is a useful convention for several reasons.


Demand curves are frequently not functions but mappings, e.g. in the case of perfectly elastic demand. So you could not guarantee 'nice' functions anyway.
In this coordinate system the surpluses (producer's and consumer's) are areas under the curves. The explanation is more intuitive and it is somewhat easer to see which integral you have to take.