Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Fix long titles overlapping plot contents #3797

Merged
merged 10 commits into from Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CITATION.cff
Expand Up @@ -312,6 +312,9 @@ authors:
family-names: Gensollen
website: https://nicolasgensollen.github.io/
affiliation: INRIA, Paris, France
- given-names: Oliver
family-names: Warrington
website: https://github.com/OliverWarrington
- given-names: Oscar
family-names: Esteban
website: https://github.com/oesteban
Expand Down
2 changes: 2 additions & 0 deletions doc/changes/latest.rst
Expand Up @@ -21,6 +21,8 @@ Fixes

- Make the :func:`~nilearn.interfaces.fmriprep.load_confounds` confounds file selection more generic (:gh:`3794` by `Taylor Salo`_).

- Change default figsizes to prevent titles from overlapping figure content (:gh:`3797` by `Yasmin Mzayek`_ and see also :gh:`2804` by `Oliver Warrington`_)

Enhancements
------------

Expand Down
11 changes: 6 additions & 5 deletions nilearn/plotting/displays/_projectors.py
Expand Up @@ -297,7 +297,7 @@
"""

_cut_displayed = "x"
_default_figsize = [2.6, 2.3]
_default_figsize = [2.6, 3.0]

Check warning on line 300 in nilearn/plotting/displays/_projectors.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_projectors.py#L300

Added line #L300 was not covered by tests


class YProjector(OrthoProjector):
Expand Down Expand Up @@ -330,7 +330,7 @@
"""

_cut_displayed = "y"
_default_figsize = [2.2, 2.3]
_default_figsize = [2.2, 3.0]

Check warning on line 333 in nilearn/plotting/displays/_projectors.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_projectors.py#L333

Added line #L333 was not covered by tests


class ZProjector(OrthoProjector):
Expand Down Expand Up @@ -363,7 +363,7 @@
"""

_cut_displayed = "z"
_default_figsize = [2.2, 2.3]
_default_figsize = [2.2, 3.4]

Check warning on line 366 in nilearn/plotting/displays/_projectors.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_projectors.py#L366

Added line #L366 was not covered by tests


class XZProjector(OrthoProjector):
Expand Down Expand Up @@ -468,6 +468,7 @@
"""

_cut_displayed = "yz"
_default_figsize = [2.2, 3.4]

Check warning on line 471 in nilearn/plotting/displays/_projectors.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_projectors.py#L471

Added line #L471 was not covered by tests


class LYRZProjector(OrthoProjector):
Expand Down Expand Up @@ -663,7 +664,7 @@
"""

_cut_displayed = "l"
_default_figsize = [2.6, 2.3]
_default_figsize = [2.6, 3.0]

Check warning on line 667 in nilearn/plotting/displays/_projectors.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_projectors.py#L667

Added line #L667 was not covered by tests


class RProjector(OrthoProjector):
Expand Down Expand Up @@ -695,7 +696,7 @@
"""

_cut_displayed = "r"
_default_figsize = [2.6, 2.3]
_default_figsize = [2.6, 2.8]

Check warning on line 699 in nilearn/plotting/displays/_projectors.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_projectors.py#L699

Added line #L699 was not covered by tests


PROJECTORS = dict(
Expand Down
10 changes: 6 additions & 4 deletions nilearn/plotting/displays/_slicers.py
Expand Up @@ -850,6 +850,7 @@

_cut_displayed = "yxz"
_axes_class = CutAxes
_default_figsize = [2.2, 3.5]

Check warning on line 853 in nilearn/plotting/displays/_slicers.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_slicers.py#L853

Added line #L853 was not covered by tests

@fill_doc
@classmethod
Expand Down Expand Up @@ -1079,7 +1080,7 @@

_cut_displayed = "yxz"
_axes_class = CutAxes
_default_figsize = [2.0, 6.0]
_default_figsize = [2.0, 7.6]

Check warning on line 1083 in nilearn/plotting/displays/_slicers.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_slicers.py#L1083

Added line #L1083 was not covered by tests

@classmethod
def find_cut_coords(cls, img=None, threshold=None, cut_coords=None):
Expand Down Expand Up @@ -1624,7 +1625,7 @@
"""

_direction = "y"
_default_figsize = [2.2, 2.3]
_default_figsize = [2.2, 3.0]

Check warning on line 1628 in nilearn/plotting/displays/_slicers.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_slicers.py#L1628

Added line #L1628 was not covered by tests


class ZSlicer(BaseStackedSlicer):
Expand Down Expand Up @@ -1662,7 +1663,7 @@
"""

_direction = "z"
_default_figsize = [2.2, 2.3]
_default_figsize = [2.2, 3.2]

Check warning on line 1666 in nilearn/plotting/displays/_slicers.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_slicers.py#L1666

Added line #L1666 was not covered by tests


class XZSlicer(OrthoSlicer):
Expand Down Expand Up @@ -1774,6 +1775,7 @@
"""

_cut_displayed = "yz"
_default_figsize = [2.2, 3.0]

Check warning on line 1778 in nilearn/plotting/displays/_slicers.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_slicers.py#L1778

Added line #L1778 was not covered by tests


class MosaicSlicer(BaseSlicer):
Expand Down Expand Up @@ -1816,7 +1818,7 @@

_cut_displayed = "yxz"
_axes_class = CutAxes
_default_figsize = [11.1, 7.2]
_default_figsize = [11.1, 20.0]

Check warning on line 1821 in nilearn/plotting/displays/_slicers.py

View check run for this annotation

Codecov / codecov/patch

nilearn/plotting/displays/_slicers.py#L1821

Added line #L1821 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

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

this seems like a large increase, why is it necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

this seems like a large increase, why is it necessary?

It was hard to get the title not to overlap and then to me the rendering in the examples seemed better since the brains are bigger and closer together so less white space. See the mosaic plots in this example (old vs new).


@classmethod
def find_cut_coords(cls, img=None, threshold=None, cut_coords=None):
Expand Down