Repository: yt-project/yt

Issue:
BUG: symlog colorbar minor ticks are not drawn when vmax and vmin are both strictly negative
### Bug report

**Bug summary**

Similar to #3535, but specifically for the case vmax and vmin are both strictly negative

**Code for reproduction**
Using matplotlib 3.5.0rc1

```python
import yt

ds = yt.testing.fake_amr_ds(fields=[("gas", "density")], units=["g/cm**3"], geometry="polar")
yt.testing.add_noise_fields(ds)
p = yt.SlicePlot(ds, "z", "noise2")

p.save(f"/tmp/")
```

and using this temporary patch to make it testable before 3.5.0 final is released
```patch
diff --git a/yt/visualization/plot_window.py b/yt/visualization/plot_window.py
index 53a1fe9ad..4a78ef179 100644
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1223,7 +1223,7 @@ class PWViewerMPL(PlotWindow):
                     self.plots[f].cax.minorticks_on()

                 elif self._field_transform[f] == symlog_transform:
-                    if Version("3.2.0") <= MPL_VERSION < Version("3.5.0"):
+                    if Version("3.2.0") <= MPL_VERSION < Version("3.5.0b"):
                         # no known working method to draw symlog minor ticks
                         # see https://github.com/yt-project/yt/issues/3535
                         pass
@@ -1232,7 +1232,7 @@ class PWViewerMPL(PlotWindow):
                             np.log10(self.plots[f].cb.norm.linthresh)
                         )
                         mticks = get_symlog_minorticks(flinthresh, vmin, vmax)
-                        if MPL_VERSION < Version("3.5.0"):
+                        if MPL_VERSION < Version("3.5.0b"):
                             # https://github.com/matplotlib/matplotlib/issues/21258
                             mticks = self.plots[f].image.norm(mticks)
                         self.plots[f].cax.yaxis.set_ticks(mticks, minor=True)
```

**Actual outcome**
![cb_mpl_v3 4 3_Slice_z_noise2](https://user-images.githubusercontent.com/14075922/137103837-a1c1f8ed-eccc-442e-a8d8-2a6ea949f751.png)


**Expected outcome**
![cb_mpl_v3 5 0rc1_Slice_z_noise2](https://user-images.githubusercontent.com/14075922/137104365-f747d39c-ae9a-4c50-b837-60dcef34fe1a.png)

(minor ticks are drawn)



Discussion:

Resolving patch:
diff --git a/yt/visualization/base_plot_types.py b/yt/visualization/base_plot_types.py
--- a/yt/visualization/base_plot_types.py
+++ b/yt/visualization/base_plot_types.py
@@ -285,13 +285,18 @@ def _init_image(self, data, cbnorm, cblinthresh, cmap, extent, aspect):
                     )
                 )
             elif zmax <= 0.0:
+                if MPL_VERSION >= Version("3.5.0b"):
+                    offset = 0
+                else:
+                    offset = 1
+
                 yticks = (
                     list(
                         -(
                             10
                             ** np.arange(
                                 np.floor(np.log10(-zmin)),
-                                np.rint(np.log10(cblinthresh)) - 1,
+                                np.rint(np.log10(cblinthresh)) - offset,
                                 -1,
                             )
                         )
diff --git a/yt/visualization/plot_container.py b/yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -182,8 +182,10 @@ def get_symlog_minorticks(linthresh, vmin, vmax):
         the maximum value in the colorbar
 
     """
-    if vmin > 0 or vmax < 0:
+    if vmin > 0:
         return get_log_minorticks(vmin, vmax)
+    elif vmax < 0 and vmin < 0:
+        return -get_log_minorticks(-vmax, -vmin)
     elif vmin == 0:
         return np.hstack((0, get_log_minorticks(linthresh, vmax)))
     elif vmax == 0:
diff --git a/yt/visualization/plot_window.py b/yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -1194,7 +1194,7 @@ def _setup_plots(self):
                     self.plots[f].cax.minorticks_on()
 
                 elif self._field_transform[f] == symlog_transform:
-                    if Version("3.2.0") <= MPL_VERSION < Version("3.5.0"):
+                    if Version("3.2.0") <= MPL_VERSION < Version("3.5.0b"):
                         # no known working method to draw symlog minor ticks
                         # see https://github.com/yt-project/yt/issues/3535
                         pass
@@ -1203,7 +1203,7 @@ def _setup_plots(self):
                             np.log10(self.plots[f].cb.norm.linthresh)
                         )
                         mticks = get_symlog_minorticks(flinthresh, vmin, vmax)
-                        if MPL_VERSION < Version("3.5.0"):
+                        if MPL_VERSION < Version("3.5.0b"):
                             # https://github.com/matplotlib/matplotlib/issues/21258
                             mticks = self.plots[f].image.norm(mticks)
                         self.plots[f].cax.yaxis.set_ticks(mticks, minor=True)


Test patch: