Aims. We aim at measuring the chemical gradients of the elements Mg, Al, Si, and Fe along the Galactic radius to provide new constraints on the chemical evolution models of the Galaxy and Galaxy models such as the Besançon model. Thanks to the large number of stars of our RAVE sample we can study how the gradients vary as function of the distance from the Galactic plane. Methods. We analysed three different samples selected from three independent datasets: a sample of 19 962 dwarf stars selected from the RAVE database, a sample of 10 616 dwarf stars selected from the Geneva-Copenhagen Survey (GCS) dataset, and a mock sample (equivalent to the RAVE sample) created by using the GALAXIA code, which is based on the Besançon model. The three samples were analysed by using the very same method for comparison purposes. We integrated the Galactic orbits and obtained the guiding radii (Rg) and the maximum distances from the Galactic plane reached by the stars along their orbits (Z max). We measured the chemical gradients as functions of R g at different Zmax. Results. We found that the chemical gradients of the RAVE and GCS samples are negative and show consistent trends, although they are not equal: at Zmax< 0.4 kpc and 4.5 <R g(kpc) < 9.5, the iron gradient for the RAVE sample is d [Fe/H] /dRg = -0.065 dex kpc-1, whereas for the GCS sample it is d [Fe/H] /dRg = -0.043 dex kpc-1 with internal errors of ±0.002 and ±0.004 dex kpc-1, respectively. The gradients of the RAVE and GCS samples become flatter at larger Zmax. Conversely, the mock sample has a positive iron gradient of d [Fe/H] /dR g = +0.053 ± 0.003 dex kpc-1 at Zmax< 0.4 kpc and remains positive at any Zmax. These positive and unrealistic values originate from the lack of correlation between metallicity and tangential velocity in the Besançon model. In addition, the low metallicity and asymmetric drift of the thick disc causes a shift of the stars towards lower Rg and metallicity which, together with the thin-disc stars with a higher metallicity and Rg, generates a fictitious positive gradient of the full sample. The flatter gradient at larger Z max found in the RAVE and the GCS samples may therefore be due to the superposition of thin- and thick-disc stars, which mimicks a flatter or positive gradient. This does not exclude the possibility that the thick disc has no chemical gradient. The discrepancies between the observational samples and the mock sample can be reduced by i) decreasing the density; ii) decreasing the vertical velocity; and iii) increasing the metallicity of the thick disc in the Besançon model.