Space-resolved spectra of line-shaped laser-produced magnesium plasmas in the normal direction of the target have been obtained using a pinhole crystal spectrograph. These spectra are treated by a spectrum analyzing code for obtaining the true spectra and fine structures of overlapped lines. The spatial distributions of electron temperature and density along the normal direction of the target surface have been obtained with different spectral diagnostic techniques. Especially, the electron density plateaus beyond the critical surface in line-shaped magnesium plasmas have been obtained with a fitting technique applied to the Stark-broadened Ly-α wings of hydrogenic ions. The difference of plasma parameters between those obtained by different diagnostic techniques is discussed. Other phenomena, such as plasma satellites, population inversion, etc., which are observed in magnesium plasmas, are also presented.