In data analysis one must often analyze data sets whose observations are related by a graph structure. This is the case for electoral data, where the electoral units correspond to a definite geographical areas. In this case it can be interesting to analyze the same phenomenon fixing some a priori relation. The author presents the rationale of these methods. The local analysis aims to eliminate the effect of geographical position of individuals, represented by a contiguity graph, in an exploratory factorial analysis of spatial data. It is interesting to analyze the electoral results keeping the socio-economic position constant, by means of a similarity graph. This is called partial analysis because it is based on the same idea of instrumental variables of Rao and partial correlation analysis. The methodology is applied to the data matrix formed by 1059 electoral units, called sections, giving the electoral results in the last autonomous election of 1984 in Barcelona.