Repository: nilearn/nilearn

Issue:
[BUG] Colorbar is unreadable with plot_stat_map in mosaic mode
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Operating system

- [ ] Linux
- [X] Mac
- [ ] Windows

### Operating system version

- Mac OS Version 14.2.1 "Sonoma"

### Python version

- [ ] 3.12
- [ ] 3.11
- [ ] 3.10
- [X] 3.9
- [ ] 3.8

### nilearn version

0.10.3

### Expected behavior

I would expect the colorbar to be thick enough to interpret, with labels large enough to read.

### Current behavior & error messages

No error message, but here is an example figure:
![image](https://github.com/nilearn/nilearn/assets/8228902/99a4ba4a-b4e5-4f6b-9165-f60a708e4115)



### Steps and code to reproduce bug

```python
from nilearn import datasets, plotting

stat_img = datasets.load_sample_motor_activation_image()
display = plotting.plot_stat_map(stat_img, display_mode="mosaic", annotate=False, output_file="test.png")
```


Discussion:
youch!
indeed not the best!

Resolving patch:
diff --git a/nilearn/plotting/displays/_slicers.py b/nilearn/plotting/displays/_slicers.py
--- a/nilearn/plotting/displays/_slicers.py
+++ b/nilearn/plotting/displays/_slicers.py
@@ -273,8 +273,6 @@ def add_overlay(
                   values below the threshold (in absolute value) are
                   plotted as transparent.
 
-
-
         cbar_tick_format: str, default="%%.2g" (scientific notation)
             Controls how to format the tick labels of the colorbar.
             Ex: use "%%i" to display as integers.
@@ -282,7 +280,6 @@ def add_overlay(
         colorbar : :obj:`bool`, default=False
             If ``True``, display a colorbar on the right of the plots.
 
-
         kwargs : :obj:`dict`
             Extra keyword arguments are passed to function
             :func:`~matplotlib.pyplot.imshow`.
@@ -1861,7 +1858,7 @@ class MosaicSlicer(BaseSlicer):
 
     _cut_displayed = "yxz"
     _axes_class = CutAxes
-    _default_figsize = [11.1, 20.0]
+    _default_figsize = [4.0, 5.0]
 
     @classmethod
     def find_cut_coords(cls, img=None, threshold=None, cut_coords=None):
@@ -1954,6 +1951,8 @@ def _find_cut_coords(img, cut_coords, cut_displayed):
     def _init_axes(self, **kwargs):
         """Initialize and place axes for display of 'xyz' multiple cuts.
 
+        Also adapts the width of the color bar relative to the axes.
+
         Parameters
         ----------
         kwargs : :obj:`dict`
@@ -1970,7 +1969,7 @@ def _init_axes(self, **kwargs):
         x0, y0, x1, y1 = self.rect
 
         # Create our axes:
-        self.axes = dict()
+        self.axes = {}
         # portions for main axes
         fraction = y1 / len(self.cut_coords)
         height = fraction
@@ -2004,6 +2003,10 @@ def _init_axes(self, **kwargs):
                 self.axes[(direction, coord)] = display_ax
                 ax.set_axes_locator(self._locator)
 
+        # increase color bar width to adapt to the number of cuts
+        #  see issue https://github.com/nilearn/nilearn/pull/4284
+        self._colorbar_width *= len(coords) ** 1.1
+
     def _locator(self, axes, renderer):
         """Adjust the size of the axes.
 


Test patch: