Gradient analysis uses ordination methods to study the structure of biotic communities caused by biotic processes operating in a heterogeneous environment. This. structure has two spatial components: spatial processes within the community create autocorrelation, and the spatial structure of environmental factors creates spatial dependence. Ordination methods', however, do not make use of spatial information. Spatial alternatives are available in multivariate geostatistics, but are not compatible with important ordination methods used in gradient analysis, correspondence analysis and canonical correspondence analysis (CA, CCA). This paper shows how CA and CCA can be partitioned by distance (indirect and direct multi-scale ordination) and integrated with geostatistics. A diagnostic tool enables ecologists to partition ordination results by distance, to distinguish between components of spatial dependence and of spatial autocorrelation, and to check assumptions of independent residuals, stationarity, and scale-invariant correlation. The application is illustrated with a well-known data set of oribatid mites. Empirical chi-square variograms of individual species, their pair-wise cross variograms, and the variogram of the total inertia are defined and summarized in a variogram matrix, which leads to a spatial partitioning of the eigenvalues. The empirical variogram matrix provides a link to coregionalization analysis that may be used to simultaneously model spatial dependence and spatial autocorrelation. This will be useful for answering questions about the organism-specific scale of response to the environment, the optimal spacing of sampling units, or the scale-dependent effect of environmental factors.