diff --git a/doc/changes/dev/13558.bugfix.rst b/doc/changes/dev/13558.bugfix.rst new file mode 100644 index 00000000000..820373b2e2c --- /dev/null +++ b/doc/changes/dev/13558.bugfix.rst @@ -0,0 +1 @@ +Fix axis limits in :meth:`mne.preprocessing.eyetracking.calibration.Calibration.plot` to use screen resolution if available, by :newcontrib:`Gnaneswar Lopinti`. \ No newline at end of file diff --git a/doc/changes/names.inc b/doc/changes/names.inc index 77e665ec6ed..ac735f5d835 100644 --- a/doc/changes/names.inc +++ b/doc/changes/names.inc @@ -106,6 +106,7 @@ .. _Gennadiy Belonosov: https://github.com/Genuster .. _Geoff Brookshire: https://github.com/gbrookshire .. _George O'Neill: https://georgeoneill.github.io +.. _Gnaneswar Lopinti: https://github.com/flying-spagetti .. _Gonzalo Reina: https://orcid.org/0000-0003-4219-2306 .. _Guillaume Dumas: https://mila.quebec/en/person/guillaume-dumas .. _Guillaume Favelier: https://github.com/GuillaumeFavelier diff --git a/mne/preprocessing/eyetracking/calibration.py b/mne/preprocessing/eyetracking/calibration.py index 867119557a8..d240c6dca5f 100644 --- a/mne/preprocessing/eyetracking/calibration.py +++ b/mne/preprocessing/eyetracking/calibration.py @@ -169,6 +169,10 @@ def plot(self, show_offsets=True, axes=None, show=True): # Invert y-axis because the origin is in the top left corner ax.invert_yaxis() + if self["screen_resolution"] is not None: + w, h = self["screen_resolution"] + ax.set_xlim(0, w) + ax.set_ylim(h, 0) ax.scatter(px, py, color="gray") ax.scatter(gaze_x, gaze_y, color="red", alpha=0.5)