Skip to content

Conversation

@flying-spagetti
Copy link
Contributor

Reference issue:
Addresses #13538

What does this implement/fix?
As discussed in issue #13538, the calibration plot previously defaulted to tight axis limits around the available data points. This could make it difficult to interpret the calibration quality relative to the actual screen dimensions.

This PR updates the Calibration.plot method in mne/preprocessing/eyetracking/calibration.py. It adds a check for the screen_resolution metadata. If available, it uses these dimensions to set the xlim and ylim of the plot, placing the calibration points in their correct spatial context relative to the full screen.

Additional information
I reproduced this locally using the standard eyelink dataset. I manually injected a (1920, 1080) resolution into the object to verify the fix works as intended.

@scott-huberty
Copy link
Contributor

Thanks @flying-spagetti ! Checkout our contributing guide, You will need to add a change log entry, and looks like you also need to create an account on CircleCI. If you sign in to CircleCi with your GitHub account, then the CI's in this PR will be able to easily verify that there is a CircleCI account associated with your GitHub account, and the checks should run.

@@ -0,0 +1 @@
Fix axis limits in :func:`mne.preprocessing.eyetracking.calibration.Calibration.plot` to use screen resolution if available, by :newcontrib:`Gnaneswar Lopinti`. No newline at end of file
Copy link
Contributor

@scott-huberty scott-huberty Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Fix axis limits in :func:`mne.preprocessing.eyetracking.calibration.Calibration.plot` to use screen resolution if available, by :newcontrib:`Gnaneswar Lopinti`.
Fix axis limits in :meth:`mne.preprocessing.eyetracking.calibration.Calibration.plot` to use screen resolution if available, by :newcontrib:`Gnaneswar Lopinti`.

(technically it is a method of the class Calibration).

Upon your next commit, the CircleCI Jobs should run! As long as the Pre-commit bot doesn't intercept you with fixes like it did to your last commit.

@flying-spagetti
Copy link
Contributor Author

Thanks @scott-huberty for pointing the reference mistake!!
Applied the fix and i hope the CI checks should be good to go now.

@scott-huberty
Copy link
Contributor

Awesome! Look like the failures we are getting now are real! The good news is that the failures appear to be unrelated to this PR.

We might need you to hang tight for a bit until we fix them.

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Fix axis limits in :meth:`mne.preprocessing.eyetracking.calibration.Calibration.plot` to use screen resolution if available, by :newcontrib:`Gnaneswar Lopinti`.
Fix axis limits in :meth:`mne.preprocessing.eyetracking.Calibration.plot` to use screen resolution if available, by :newcontrib:`Gnaneswar Lopinti`.

xref the failing test in the build_docs CI

Per the hint in the Warning admonition in the contributing guide, I think that the API entry point we need to reference is mne.preprocessing.eyetracking.Calibration, as this is the entry point we document in python_reference.rst, e.g. here

@scott-huberty
Copy link
Contributor

Thanks @flying-spagetti ! I'd like to update the main eyetracking tutorial to reflect this update plotting functionality. Give this message a thumbs up 👍 if it is OK that I push a commit directly to this PR.

@scott-huberty
Copy link
Contributor

Alright! Here is the updated tutorial.

Marking for merge when green.

@scott-huberty scott-huberty enabled auto-merge (squash) January 21, 2026 02:40
@scott-huberty scott-huberty merged commit db089c9 into mne-tools:main Jan 21, 2026
41 of 42 checks passed
@welcome
Copy link

welcome bot commented Jan 21, 2026

🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants