Observations of a relation between continuum intensity and magnetic field strength in sunspots have been made during nearly five decades. This work presents full-Stokes measurements of the full-split (g = 3) line Fe I 1564.85 nm with spatial resolution of 0.5 obtained with the GREGOR Infrared Spectrograph in three large sunspots. The continuum intensity is corrected for instrumental scattered light and the brightness temperature is calculated. Magnetic field strength and inclination are derived directly from the line split and the ratio of Stokes components. The continuum intensity (temperature) relations to the field strength are studied separately in the umbra, light bridges, and penumbra. The results are consistent with previous studies and it was found that the scatter of values in the relations increases with increasing spatial resolution thanks to resolved fine structures. The observed relations show trends common for the umbra, light bridges, and the inner penumbra, while the outer penumbra has a weaker magnetic field compared to the inner penumbra at equal continuum intensities. This fact can be interpreted in terms of the interlocking comb magnetic structure of the penumbra. A comparison with data obtained from numerical simulations was made. The simulated data have a generally stronger magnetic field and a weaker continuum intensity than the observations, which may be explained by stray light and limited spatial resolution of the observations and by photometric inaccuracies of the simulations.