  The distribution of magnetic fields of positive and negative polarities over
the surface of the Sun was studied. Synoptic maps of the photospheric magnetic
field (NSO Kitt Peak, 1978--2016) were used for the analysis. In the
time-latitude diagram for weak magnetic fields ($B \leq 5 G$), inclined bands
are clearly visible, indicating the alternating dominance of magnetic fields
with positive or negative polarity drifting towards the poles of the Sun.
Analysis of the time-latitude diagram using the method of empirical orthogonal
functions (EOF) made it possible to establish a cyclic change in the polarity
of magnetic field flows with a period of 1-3 years, which indicates a possible
connection with quasi biennial variation. Similar period values are obtained by
averaging over the latitude of the time-latitude diagram
