Results of first-principles calculations on pure and doped aluminum clusters are analyzed using the electron localization function (ELF) to obtain a real-space representation of the electronic shell structure. Our results provide a quantitative analysis of the bonding nature and localization of charge in jelliumlike metal clusters and show that similar to atoms, ELF reproduces the electronic shell structure of clusters in real space. {\textcopyright} 2001 The American Physical Society.