We analyzed measurements of the direction of maximum horizontal compressive stress as a function of depth in two scientific research wells near the San Andreas Fault in central and southern California. We found that the stress orientations exhibit scale-invariant fluctuations over intervals from tens of cm to several km. Similarity between the scaling of the stress orientation fluctuations and the scaling of earthquake frequency with fault size suggests that these fluctuations are controlled by stress perturbations caused by slip on faults of various sizes in the critically-stressed crust adjacent to the fault. The apparent difference in stress scaling parameters between the two studies wells seem to correspond to differences in the earthquake magnitude-frequency statistics for the creeping versus locked sections of the fault along which these two wells are located. This suggests that stress heterogeneity adjacent to active faults like the San Andreas may reflect variations in stresses and loading conditions along the fault.