Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/dev/13558.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix axis limits in :meth:`mne.preprocessing.eyetracking.calibration.Calibration.plot` to use screen resolution if available, by :newcontrib:`Gnaneswar Lopinti`.
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

1 change: 1 addition & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions mne/preprocessing/eyetracking/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading