Where do the bubbles in a glass of water come from? This weekend I accidentally left a glass of water on my kitchen table for a few days while I was out of town. Unsurprisingly, bubbles formed on the walls.  

As I understand from the last time I attended a chemistry class quite a while ago, this happens due to water self-ionizing (at about a ratio of $10^{-14}$ if I recall correctly).

$$\ce{H2O + H2O \rightleftharpoons H3O+ + OH-}$$

However, for some reason, the bubbles only formed up to a certain depth:



What is the reason for this? Does self-ionization happen uniformly in the glass? Do bubbles start forming from the top down and would they have reached the bottom if left untouched for longer?
Gases are less soluble in warm water than cold water.

The bubbles are likely from dissolved gas coming out of solution as the water warmed.  

The bubbles are unrelated to self-ionization of water.  The self-ionization does vary somewhat with pressure, so at an extreme depth in the ocean you might need to consider what Kw is, but not in a glass of water.

The solubility of gases increases with pressure, so on this basis it is more likely that you would have bubble appear near the top.  However, the pressure is only 1-2% greater at the bottom of the glass compare to the top.  There may be fewer nucleation sites (such as tiny scratches) near the bottom of that particular glass.  Also, if the bubbles move up along the wall sometimes, it would be logical that there are less at the bottom.