Coverage for nilearn/plotting/displays/_projectors.py: 0%
115 statements
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-16 12:32 +0200
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-16 12:32 +0200
1import warnings
2from typing import ClassVar
4import matplotlib.pyplot as plt
5import numpy as np
6from matplotlib import cm as mpl_cm
7from scipy.sparse import issparse
8from scipy.stats import scoreatpercentile
10from nilearn import DEFAULT_DIVERGING_CMAP
11from nilearn._utils.logger import find_stack_level
12from nilearn._utils.param_validation import check_threshold
13from nilearn.plotting.displays._axes import GlassBrainAxes
14from nilearn.plotting.displays._slicers import OrthoSlicer
15from nilearn.plotting.displays._utils import get_create_display_fun
18class OrthoProjector(OrthoSlicer):
19 """A class to create linked axes for plotting orthogonal projections \
20 of 3D maps.
22 This visualization mode can be activated from
23 :func:`~nilearn.plotting.plot_glass_brain`, by setting
24 ``display_mode='ortho'``:
26 .. code-block:: python
28 from nilearn.datasets import load_mni152_template
29 from nilearn.plotting import plot_glass_brain
31 img = load_mni152_template()
32 # display is an instance of the OrthoProjector class
33 display = plot_glass_brain(img, display_mode="ortho")
35 Attributes
36 ----------
37 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
38 The 3 axes used to plot each view ('x', 'y', and 'z').
40 frame_axes : :class:`~matplotlib.axes.Axes`
41 The axes framing the whole set of views.
43 """
45 _axes_class = GlassBrainAxes # type: ignore[assignment]
47 @classmethod
48 def find_cut_coords(
49 cls,
50 img=None, # noqa: ARG003
51 threshold=None, # noqa: ARG003
52 cut_coords=None, # noqa: ARG003
53 ):
54 """Find the coordinates of the cut."""
55 return (None,) * len(cls._cut_displayed)
57 def draw_cross(self, cut_coords=None, **kwargs):
58 """Do nothing.
60 It does not make sense to draw crosses for the position of
61 the cuts since we are taking the max along one axis.
62 """
63 pass
65 def _check_inputs_add_graph(
66 self,
67 adjacency_matrix,
68 node_coords,
69 node_color,
70 node_kwargs,
71 ):
72 """Perform the input checks and raise different types of errors.
74 ``_check_inputs_add_graph`` is called inside the method ``add_graph``.
75 """
76 # safety checks
77 if "s" in node_kwargs:
78 raise ValueError(
79 "Please use 'node_size' and not 'node_kwargs' "
80 "to specify node sizes."
81 )
82 if "c" in node_kwargs:
83 raise ValueError(
84 "Please use 'node_color' and not 'node_kwargs' "
85 "to specify node colors."
86 )
88 adjacency_matrix_shape = adjacency_matrix.shape
89 if (
90 len(adjacency_matrix_shape) != 2
91 or adjacency_matrix_shape[0] != adjacency_matrix_shape[1]
92 ):
93 raise ValueError(
94 "'adjacency_matrix' is supposed to have shape (n, n)."
95 f" Its shape was {adjacency_matrix_shape}."
96 )
98 node_coords_shape = node_coords.shape
99 if len(node_coords_shape) != 2 or node_coords_shape[1] != 3:
100 message = (
101 "Invalid shape for 'node_coords'. "
102 "You passed an 'adjacency_matrix' "
103 f"of shape {adjacency_matrix_shape} "
104 "therefore 'node_coords' should be a array "
105 f"with shape ({adjacency_matrix_shape[0]}, 3) "
106 f"while its shape was {node_coords_shape}."
107 )
109 raise ValueError(message)
111 if (
112 isinstance(node_color, (list, np.ndarray))
113 and len(node_color) != 1
114 and len(node_color) != node_coords_shape[0]
115 ):
116 raise ValueError(
117 "Mismatch between the number of nodes "
118 f"({node_coords_shape[0]}) "
119 f"and the number of node colors ({len(node_color)})."
120 )
122 if node_coords_shape[0] != adjacency_matrix_shape[0]:
123 raise ValueError(
124 "Shape mismatch between 'adjacency_matrix' "
125 "and 'node_coords'."
126 f"'adjacency_matrix' shape is {adjacency_matrix_shape}, "
127 f"'node_coords' shape is {node_coords_shape}."
128 )
130 def add_graph(
131 self,
132 adjacency_matrix,
133 node_coords,
134 node_color="auto",
135 node_size=50,
136 edge_cmap=DEFAULT_DIVERGING_CMAP,
137 edge_vmin=None,
138 edge_vmax=None,
139 edge_threshold=None,
140 edge_kwargs=None,
141 node_kwargs=None,
142 colorbar=False,
143 ):
144 """Plot undirected graph on each of the axes.
146 Parameters
147 ----------
148 adjacency_matrix : :class:`numpy.ndarray` of shape ``(n, n)``
149 Represents the edges strengths of the graph.
150 The matrix can be symmetric which will result in
151 an undirected graph, or not symmetric which will
152 result in a directed graph.
154 node_coords : :class:`numpy.ndarray` of shape ``(n, 3)``
155 3D coordinates of the graph nodes in world space.
157 node_color : color or sequence of colors, default='auto'
158 Color(s) of the nodes.
160 node_size : scalar or array_like, default=50
161 Size(s) of the nodes in points^2.
163 edge_cmap : :class:`~matplotlib.colors.Colormap`, default="RdBu_r"
164 Colormap used for representing the strength of the edges.
166 edge_vmin, edge_vmax : :obj:`float`, optional
167 - If not ``None``, either or both of these values will be used
168 to as the minimum and maximum values to color edges.
169 - If ``None`` are supplied, the maximum absolute value within the
170 given threshold will be used as minimum (multiplied by -1) and
171 maximum coloring levels.
173 edge_threshold : :obj:`str` or :obj:`int` or :obj:`float`, optional
174 - If it is a number only the edges with a value greater than
175 ``edge_threshold`` will be shown.
176 - If it is a string it must finish with a percent sign,
177 e.g. "25.3%", and only the edges with a abs(value) above
178 the given percentile will be shown.
180 edge_kwargs : :obj:`dict`, optional
181 Will be passed as kwargs for each edge
182 :class:`~matplotlib.lines.Line2D`.
184 node_kwargs : :obj:`dict`
185 Will be passed as kwargs to the function
186 :func:`~matplotlib.pyplot.scatter` which plots all the
187 nodes at one.
188 """
189 # set defaults
190 edge_kwargs = edge_kwargs or {}
191 node_kwargs = node_kwargs or {}
192 if isinstance(node_color, str) and node_color == "auto":
193 node_color = mpl_cm.Set2(np.linspace(0, 1, len(node_coords)))
194 node_coords = np.asarray(node_coords)
196 # decompress input matrix if sparse
197 if issparse(adjacency_matrix):
198 adjacency_matrix = adjacency_matrix.toarray()
200 # make the lines below well-behaved
201 adjacency_matrix = np.nan_to_num(adjacency_matrix)
203 self._check_inputs_add_graph(
204 adjacency_matrix, node_coords, node_color, node_kwargs
205 )
207 # If the adjacency matrix is not symmetric, give a warning
208 symmetric = True
209 if not np.allclose(adjacency_matrix, adjacency_matrix.T, rtol=1e-3):
210 symmetric = False
211 warnings.warn(
212 "'adjacency_matrix' is not symmetric.\n"
213 "A directed graph will be plotted.",
214 stacklevel=find_stack_level(),
215 )
217 # For a masked array, masked values are replaced with zeros
218 if hasattr(adjacency_matrix, "mask"):
219 if not (adjacency_matrix.mask == adjacency_matrix.mask.T).all():
220 symmetric = False
221 warnings.warn(
222 "'adjacency_matrix' was masked \
223 with a non symmetric mask.\n"
224 "A directed graph will be plotted.",
225 stacklevel=find_stack_level(),
226 )
227 adjacency_matrix = adjacency_matrix.filled(0)
229 if edge_threshold is not None:
230 if symmetric:
231 # Keep a percentile of edges with the highest absolute
232 # values, so only need to look at the covariance
233 # coefficients below the diagonal
234 lower_diagonal_indices = np.tril_indices_from(
235 adjacency_matrix, k=-1
236 )
237 lower_diagonal_values = adjacency_matrix[
238 lower_diagonal_indices
239 ]
240 edge_threshold = check_threshold(
241 edge_threshold,
242 np.abs(lower_diagonal_values),
243 scoreatpercentile,
244 "edge_threshold",
245 )
246 else:
247 edge_threshold = check_threshold(
248 edge_threshold,
249 np.abs(adjacency_matrix.ravel()),
250 scoreatpercentile,
251 "edge_threshold",
252 )
254 adjacency_matrix = adjacency_matrix.copy()
255 threshold_mask = np.abs(adjacency_matrix) < edge_threshold
256 adjacency_matrix[threshold_mask] = 0
258 if symmetric:
259 lower_triangular_adjacency_matrix = np.tril(adjacency_matrix, k=-1)
260 non_zero_indices = lower_triangular_adjacency_matrix.nonzero()
261 else:
262 non_zero_indices = adjacency_matrix.nonzero()
264 line_coords = [
265 node_coords[list(index)] for index in zip(*non_zero_indices)
266 ]
268 adjacency_matrix_values = adjacency_matrix[non_zero_indices]
269 for ax in self.axes.values():
270 ax._add_markers(node_coords, node_color, node_size, **node_kwargs)
271 if line_coords:
272 ax._add_lines(
273 line_coords,
274 adjacency_matrix_values,
275 edge_cmap,
276 vmin=edge_vmin,
277 vmax=edge_vmax,
278 directed=(not symmetric),
279 **edge_kwargs,
280 )
281 # To obtain the brain left view, we simply invert the x axis
282 if ax.direction == "l" and not (
283 ax.ax.get_xlim()[0] > ax.ax.get_xlim()[1]
284 ):
285 ax.ax.invert_xaxis()
287 if colorbar:
288 self._colorbar = colorbar
289 self._show_colorbar(ax.cmap, ax.norm, threshold=edge_threshold)
291 plt.draw_if_interactive()
294class XProjector(OrthoProjector):
295 """The ``XProjector`` class enables sagittal visualization through 2D \
296 projections with :func:`~nilearn.plotting.plot_glass_brain`.
298 This visualization mode can be activated by setting ``display_mode='x'``:
300 .. code-block:: python
302 from nilearn.datasets import load_mni152_template
303 from nilearn.plotting import plot_glass_brain
305 img = load_mni152_template()
306 # display is an instance of the XProjector class
307 display = plot_glass_brain(img, display_mode="x")
309 Attributes
310 ----------
311 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
312 The axes used for plotting.
314 frame_axes : :class:`~matplotlib.axes.Axes`
315 The axes framing the whole set of views.
317 See Also
318 --------
319 nilearn.plotting.displays.YProjector : Coronal view
320 nilearn.plotting.displays.ZProjector : Axial view
322 """
324 _cut_displayed: ClassVar[str] = "x"
325 _default_figsize: ClassVar[list[float]] = [2.6, 3.0]
328class YProjector(OrthoProjector):
329 """The ``YProjector`` class enables coronal visualization through 2D \
330 projections with :func:`~nilearn.plotting.plot_glass_brain`.
332 This visualization mode can be activated by setting ``display_mode='y'``:
334 .. code-block:: python
336 from nilearn.datasets import load_mni152_template
337 from nilearn.plotting import plot_glass_brain
339 img = load_mni152_template()
340 # display is an instance of the YProjector class
341 display = plot_glass_brain(img, display_mode="y")
343 Attributes
344 ----------
345 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
346 The axes used for plotting.
348 frame_axes : :class:`~matplotlib.axes.Axes`
349 The axes framing the whole set of views.
351 See Also
352 --------
353 nilearn.plotting.displays.XProjector : Sagittal view
354 nilearn.plotting.displays.ZProjector : Axial view
356 """
358 _cut_displayed: ClassVar[str] = "y"
359 _default_figsize: ClassVar[list[float]] = [2.2, 3.0]
362class ZProjector(OrthoProjector):
363 """The ``ZProjector`` class enables axial visualization through 2D \
364 projections with :func:`~nilearn.plotting.plot_glass_brain`.
366 This visualization mode can be activated by setting ``display_mode='z'``:
368 .. code-block:: python
370 from nilearn.datasets import load_mni152_template
371 from nilearn.plotting import plot_glass_brain
373 img = load_mni152_template()
374 # display is an instance of the ZProjector class
375 display = plot_glass_brain(img, display_mode="z")
377 Attributes
378 ----------
379 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
380 The axes used for plotting.
382 frame_axes : :class:`~matplotlib.axes.Axes`
383 The axes framing the whole set of views.
385 See Also
386 --------
387 nilearn.plotting.displays.XProjector : Sagittal view
388 nilearn.plotting.displays.YProjector : Coronal view
390 """
392 _cut_displayed: ClassVar[str] = "z"
393 _default_figsize: ClassVar[list[float]] = [2.2, 3.4]
396class XZProjector(OrthoProjector):
397 """The ``XZProjector`` class enables to combine sagittal \
398 and axial views \
399 on the same figure through 2D projections with \
400 :func:`~nilearn.plotting.plot_glass_brain`.
402 This visualization mode
403 can be activated by setting ``display_mode='xz'``:
405 .. code-block:: python
407 from nilearn.datasets import load_mni152_template
408 from nilearn.plotting import plot_glass_brain
410 img = load_mni152_template()
411 # display is an instance of the XZProjector class
412 display = plot_glass_brain(img, display_mode="xz")
414 Attributes
415 ----------
416 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
417 The axes used for plotting in each direction ('x' and 'z' here).
419 frame_axes : :class:`~matplotlib.axes.Axes`
420 The axes framing the whole set of views.
422 See Also
423 --------
424 nilearn.plotting.displays.YXProjector : Coronal + Sagittal views
425 nilearn.plotting.displays.YZProjector : Coronal + Axial views
427 """
429 _cut_displayed = "xz"
432class YXProjector(OrthoProjector):
433 """The ``YXProjector`` class enables to combine coronal \
434 and sagittal views \
435 on the same figure through 2D projections with \
436 :func:`~nilearn.plotting.plot_glass_brain`.
438 This visualization mode
439 can be activated by setting ``display_mode='yx'``:
441 .. code-block:: python
443 from nilearn.datasets import load_mni152_template
444 from nilearn.plotting import plot_glass_brain
446 img = load_mni152_template()
447 # display is an instance of the YXProjector class
448 display = plot_glass_brain(img, display_mode="yx")
450 Attributes
451 ----------
452 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
453 The axes used for plotting in each direction ('x' and 'y' here).
455 frame_axes : :class:`~matplotlib.axes.Axes`
456 The axes framing the whole set of views.
458 See Also
459 --------
460 nilearn.plotting.displays.XZProjector : Sagittal + Axial views
461 nilearn.plotting.displays.YZProjector : Coronal + Axial views
463 """
465 _cut_displayed = "yx"
468class YZProjector(OrthoProjector):
469 """The ``YZProjector`` class enables to combine coronal and axial views \
470 on the same figure through 2D projections with \
471 :func:`~nilearn.plotting.plot_glass_brain`.
473 This visualization mode
474 can be activated by setting ``display_mode='yz'``:
476 .. code-block:: python
478 from nilearn.datasets import load_mni152_template
479 from nilearn.plotting import plot_glass_brain
481 img = load_mni152_template()
482 # display is an instance of the YZProjector class
483 display = plot_glass_brain(img, display_mode="yz")
485 Attributes
486 ----------
487 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
488 The axes used for plotting in each direction ('y' and 'z' here).
490 frame_axes : :class:`~matplotlib.axes.Axes`
491 The axes framing the whole set of views.
493 See Also
494 --------
495 nilearn.plotting.displays.XZProjector : Sagittal + Axial views
496 nilearn.plotting.displays.YXProjector : Coronal + Sagittal views
498 """
500 _cut_displayed: ClassVar[str] = "yz"
501 _default_figsize: ClassVar[list[float]] = [2.2, 3.4]
504class LYRZProjector(OrthoProjector):
505 """The ``LYRZProjector`` class enables ? visualization \
506 on the same figure through 2D projections with \
507 :func:`~nilearn.plotting.plot_glass_brain`.
509 This visualization mode
510 can be activated by setting ``display_mode='lyrz'``:
512 .. code-block:: python
514 from nilearn.datasets import load_mni152_template
515 from nilearn.plotting import plot_glass_brain
517 img = load_mni152_template()
518 # display is an instance of the LYRZProjector class
519 display = plot_glass_brain(img, display_mode="lyrz")
521 Attributes
522 ----------
523 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
524 The axes used for plotting in each direction ('l', 'y', 'r',
525 and 'z' here).
527 frame_axes : :class:`~matplotlib.axes.Axes`
528 The axes framing the whole set of views.
530 See Also
531 --------
532 nilearn.plotting.displays.LZRYProjector : ?? views
534 """
536 _cut_displayed = "lyrz"
539class LZRYProjector(OrthoProjector):
540 """The ``LZRYProjector`` class enables ? visualization \
541 on the same figure through 2D projections with \
542 :func:`~nilearn.plotting.plot_glass_brain`.
544 This visualization mode
545 can be activated by setting ``display_mode='lzry'``:
547 .. code-block:: python
549 from nilearn.datasets import load_mni152_template
550 from nilearn.plotting import plot_glass_brain
552 img = load_mni152_template()
553 # display is an instance of the LZRYProjector class
554 display = plot_glass_brain(img, display_mode="lzry")
556 Attributes
557 ----------
558 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
559 The axes used for plotting in each direction ('l', 'z', 'r',
560 and 'y' here).
562 frame_axes : :class:`~matplotlib.axes.Axes`
563 The axes framing the whole set of views.
565 See Also
566 --------
567 nilearn.plotting.displays.LYRZProjector : ?? views
569 """
571 _cut_displayed = "lzry"
574class LZRProjector(OrthoProjector):
575 """The ``LZRProjector`` class enables hemispheric sagittal visualization \
576 on the same figure through 2D projections with \
577 :func:`~nilearn.plotting.plot_glass_brain`.
579 This visualization mode
580 can be activated by setting ``display_mode='lzr'``:
582 .. code-block:: python
584 from nilearn.datasets import load_mni152_template
585 from nilearn.plotting import plot_glass_brain
587 img = load_mni152_template()
588 # display is an instance of the LZRProjector class
589 display = plot_glass_brain(img, display_mode="lzr")
591 Attributes
592 ----------
593 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
594 The axes used for plotting in each direction ('l', 'z' and 'r' here).
596 frame_axes : :class:`~matplotlib.axes.Axes`
597 The axes framing the whole set of views.
599 See Also
600 --------
601 nilearn.plotting.displays.LYRProjector : ?? views
603 """
605 _cut_displayed = "lzr"
608class LYRProjector(OrthoProjector):
609 """The ``LYRProjector`` class enables ? visualization \
610 on the same figure through 2D projections with \
611 :func:`~nilearn.plotting.plot_glass_brain`.
613 This visualization mode
614 can be activated by setting ``display_mode='lyr'``:
616 .. code-block:: python
618 from nilearn.datasets import load_mni152_template
619 from nilearn.plotting import plot_glass_brain
621 img = load_mni152_template()
622 # display is an instance of the LYRProjector class
623 display = plot_glass_brain(img, display_mode="lyr")
625 Attributes
626 ----------
627 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
628 The axes used for plotting in each direction ('l', 'y' and 'r' here).
630 frame_axes : :class:`~matplotlib.axes.Axes`
631 The axes framing the whole set of views.
633 See Also
634 --------
635 nilearn.plotting.displays.LZRProjector : ?? views
637 """
639 _cut_displayed = "lyr"
642class LRProjector(OrthoProjector):
643 """The ``LRProjector`` class enables left-right visualization \
644 on the same figure through 2D projections with \
645 :func:`~nilearn.plotting.plot_glass_brain`.
647 This visualization mode
648 can be activated by setting ``display_mode='lr'``:
650 .. code-block:: python
652 from nilearn.datasets import load_mni152_template
653 from nilearn.plotting import plot_glass_brain
655 img = load_mni152_template()
656 # display is an instance of the LRProjector class
657 display = plot_glass_brain(img, display_mode="lr")
659 Attributes
660 ----------
661 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
662 The axes used for plotting in each direction ('l', and 'r' here).
664 frame_axes : :class:`~matplotlib.axes.Axes`
665 The axes framing the whole set of views.
667 """
669 _cut_displayed = "lr"
672class LProjector(OrthoProjector):
673 """The ``LProjector`` class enables the visualization of left 2D \
674 projection with :func:`~nilearn.plotting.plot_glass_brain`.
676 This
677 visualization mode can be activated by setting ``display_mode='l'``:
679 .. code-block:: python
681 from nilearn.datasets import load_mni152_template
682 from nilearn.plotting import plot_glass_brain
684 img = load_mni152_template()
685 # display is an instance of the LProjector class
686 display = plot_glass_brain(img, display_mode="l")
688 Attributes
689 ----------
690 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
691 The axes used for plotting in each direction ('l' here).
693 frame_axes : :class:`~matplotlib.axes.Axes`
694 The axes framing the whole set of views.
696 See Also
697 --------
698 nilearn.plotting.displays.RProjector : right projection view
700 """
702 _cut_displayed: ClassVar[str] = "l"
703 _default_figsize: ClassVar[list[float]] = [2.6, 3.0]
706class RProjector(OrthoProjector):
707 """The ``RProjector`` class enables the visualization of right 2D \
708 projection with :func:`~nilearn.plotting.plot_glass_brain`.
710 This visualization mode can be activated by setting ``display_mode='r'``:
712 .. code-block:: python
714 from nilearn.datasets import load_mni152_template
715 from nilearn.plotting import plot_glass_brain
717 img = load_mni152_template()
718 # display is an instance of the RProjector class
719 display = plot_glass_brain(img, display_mode="r")
721 Attributes
722 ----------
723 axes : :obj:`dict` of :class:`~nilearn.plotting.displays.GlassBrainAxes`
724 The axes used for plotting in each direction ('r' here).
726 frame_axes : :class:`~matplotlib.axes.Axes`
727 The axes framing the whole set of views.
729 See Also
730 --------
731 nilearn.plotting.displays.LProjector : left projection view
733 """
735 _cut_displayed: ClassVar[str] = "r"
736 _default_figsize: ClassVar[list[float]] = [2.6, 2.8]
739PROJECTORS = {
740 "ortho": OrthoProjector,
741 "xz": XZProjector,
742 "yz": YZProjector,
743 "yx": YXProjector,
744 "x": XProjector,
745 "y": YProjector,
746 "z": ZProjector,
747 "lzry": LZRYProjector,
748 "lyrz": LYRZProjector,
749 "lyr": LYRProjector,
750 "lzr": LZRProjector,
751 "lr": LRProjector,
752 "l": LProjector,
753 "r": RProjector,
754}
757def get_projector(display_mode):
758 """Retrieve a projector from a given display mode.
760 Parameters
761 ----------
762 display_mode : {"ortho", "xz", "yz", "yx", "x", "y",\
763 "z", "lzry", "lyrz", "lyr", "lzr", "lr", "l", "r"}
764 The desired display mode.
766 Returns
767 -------
768 projector : :class:`~nilearn.plotting.displays.OrthoProjector`\
769 or instance of derived classes
771 The projector corresponding to the requested display mode:
773 - "ortho": Returns an
774 :class:`~nilearn.plotting.displays.OrthoProjector`.
775 - "xz": Returns a
776 :class:`~nilearn.plotting.displays.XZProjector`.
777 - "yz": Returns a
778 :class:`~nilearn.plotting.displays.YZProjector`.
779 - "yx": Returns a
780 :class:`~nilearn.plotting.displays.YXProjector`.
781 - "x": Returns a
782 :class:`~nilearn.plotting.displays.XProjector`.
783 - "y": Returns a
784 :class:`~nilearn.plotting.displays.YProjector`.
785 - "z": Returns a
786 :class:`~nilearn.plotting.displays.ZProjector`.
787 - "lzry": Returns a
788 :class:`~nilearn.plotting.displays.LZRYProjector`.
789 - "lyrz": Returns a
790 :class:`~nilearn.plotting.displays.LYRZProjector`.
791 - "lyr": Returns a
792 :class:`~nilearn.plotting.displays.LYRProjector`.
793 - "lzr": Returns a
794 :class:`~nilearn.plotting.displays.LZRProjector`.
795 - "lr": Returns a
796 :class:`~nilearn.plotting.displays.LRProjector`.
797 - "l": Returns a
798 :class:`~nilearn.plotting.displays.LProjector`.
799 - "z": Returns a
800 :class:`~nilearn.plotting.displays.RProjector`.
802 """
803 return get_create_display_fun(display_mode, PROJECTORS)