An eight-sided prism sample, obtained from a hot-rolled AZ31 magnesium alloy sheet, was compressed at room temperature along the transverse direction to investigate the influence of local strain on twinning behavior using electron backscatter diffraction (EBSD) measurements, hardness distribution, and metallographic observations. The octagonal surface of the sample was divided into distinct regions based on hardness distribution and metallographic observations. Combined analysis of the Schmid factor (SF) and the strain compatibility factor (m’) was employed to study twin variant selection. Basal on SF ratio distribution, the Schmid factor criterion, can predict over 75% of observed twin variants in regions A and D (normal stress samples). In contrast, 64% of twin variant selection behavior in region C (shear stress sample) can be effectively explained using a pure shear model. Twin variants with high strain compatibility factors may prefer activation to reduce stress concentration. The strain compatibility factor is more appropriate than the Schmid factor for analyzing the effect of local strain on the selection behavior of twin variants.