Repository: yt-project/yt

Issue:
OffAxisProjectionPlot missing support for non cartesian geometries
### Bug report

**Bug summary**

Seems like there is no support for off-axis projection plots in non-cartesian geometries (at least in cylindrical).
It's hard to tell from the user perspective though because the end error message seems unrelated.


**Code for reproduction**
```python
import numpy as np
import yt
bbox = np.array([[0., 1.0], [0, 1], [0, 2*np.pi]])
arr = np.random.random((128, 128, 1))
data = dict(density=arr)
ds = yt.load_uniform_grid(
    data, arr.shape,
    length_unit='AU',
    bbox=bbox,
    geometry="cylindrical" # <-the script works without this line
)
yt.OffAxisProjectionPlot(ds, normal=(1, 1, 1), fields="density")
```

**Actual outcome**

Something goes terribly wrong during input sanitizing
```
KeyError: 4
```


Discussion:
It's not clear what a user would *expect* from example I wrote in the OP. Yt is still pretty hacky with units for angular coordinates, but other than that, I don't know how to interpret a normal vector specified as 3 scalars. It *could* make sense to interpret that as a cartesian vector, but that would probably require some redesign of the API
In the mean time, a simple fix for this would be to produce a clearer error (`NotImplementedError`).
I think #3489 makes the edges cleaner in this region of the code base and could pave the way to implement a simple "fix" like this for SlicePlot and ProjectionPlot without duplicated code.

Resolving patch:
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
@@ -2345,6 +2345,7 @@ class OffAxisSlicePlot(SlicePlot, PWViewerMPL):
 
     _plot_type = "OffAxisSlice"
     _frb_generator = FixedResolutionBuffer
+    _supported_geometries = ("cartesian", "spectral_cube")
 
     def __init__(
         self,
@@ -2372,6 +2373,12 @@ def __init__(
             )
             del origin
 
+        if ds.geometry not in self._supported_geometries:
+            raise NotImplementedError(
+                f"off-axis slices are not supported for {ds.geometry!r} geometry\n"
+                f"currently supported geometries: {self._supported_geometries!r}"
+            )
+
         (bounds, center_rot) = get_oblique_window_parameters(normal, center, width, ds)
         if field_parameters is None:
             field_parameters = {}
@@ -2554,6 +2561,7 @@ class OffAxisProjectionPlot(ProjectionPlot, PWViewerMPL):
     """
     _plot_type = "OffAxisProjection"
     _frb_generator = OffAxisProjectionFixedResolutionBuffer
+    _supported_geometries = ("cartesian", "spectral_cube")
 
     def __init__(
         self,
@@ -2578,6 +2586,12 @@ def __init__(
         data_source=None,
         buff_size=(800, 800),
     ):
+        if ds.geometry not in self._supported_geometries:
+            raise NotImplementedError(
+                f"off-axis slices are not supported for {ds.geometry!r} geometry\n"
+                f"currently supported geometries: {self._supported_geometries!r}"
+            )
+
         (bounds, center_rot) = get_oblique_window_parameters(
             normal, center, width, ds, depth=depth
         )


Test patch: