Repository: yt-project/yt

Issue:
[GDF] Grids cell width is wrongly set to 1.0 for inappropriate dimension for 2D datasets.
### Bug report

**Bug summary**

I'm trying to create a simple plot for a dataset with a specific orientation: 2d, where x-axis is reduced, y-axis is horizontal and z-axis is vertical. It turns out to be pretty impossible (unless I'm missing something obvious).

Data: http://use.yt/upload/d1b9ac33

Note, you can use different data. 3D even. Just try non-standard axis orientation.

**Code for reproduction**

What I want to achieve (roughly):

```
import matplotlib.pyplot as plt
import h5py as h5
import numpy as np

with h5.File("crwind_tst_0001.h5", "r") as h5f:
    data = h5f["/data/grid_0000000000/density"][:].swapaxes(0, 2)
    data = np.squeeze(data)

fig = plt.figure(num=1, figsize=(4, 6.5))
ax = fig.add_subplot(111)
ax.set_ylim(-1000, 1000)
ax.set_xlim(-500, 500)
c = ax.imshow(
    np.log10(data.T),
    aspect="equal",
    extent=[-500, 500, -1000, 1000],
    origin="lower",
)
plt.colorbar(c)
plt.tight_layout()
fig.savefig("manual.png")
```
which yields:

![manual](https://user-images.githubusercontent.com/352673/139555101-601e83a0-f7e7-446c-ba9f-5c293f904319.png)

**Actual outcome aka Code I've tried**

1. Default SlicePlot
```
import yt
from yt.visualization.image_writer import write_image

ds = yt.load("crwind_tst_0001.h5")
slc = yt.SlicePlot(ds, "x", "density")
slc.save()  ### so wrong
```
![crwind_tst_0001_Slice_x_density](https://user-images.githubusercontent.com/352673/139555136-6191deb1-684a-4a1c-86ab-6692366d5020.png)

1. Manual slicing:

```
import numpy as np
import yt
from yt.visualization.image_writer import write_image

ds = yt.load("crwind_tst_0001.h5")
slc = ds.slice(0, 0.0)
ds.coordinates.x_axis["x"] = 2
ds.coordinates.x_axis[0] = 2
ds.coordinates.y_axis["x"] = 1
ds.coordinates.y_axis[0] = 1
frb = slc.to_frb(ds.domain_width[1], (480, 960), center=ds.domain_center, height=ds.domain_width[2])
print(frb["gas", "density"])  ## zeros...
write_image(np.log10(frb["gas", "density"]), "semi_manual.png")  ## fails...
```

**Expected Outcome**
Having this at least documented somewhere, if somebody know how to do that... This has been asked at least twice in past week at #help @ yt-project slack.

**Version Information**
<!--Please specify your platform and versions of the relevant libraries you are
using:-->
  * Operating System: Ubuntu 18.04
  * Python Version: 3.8
  * yt version: 4.0.1



Discussion:
@neutrinoceros (re: `viz:2D` label) as I mentioned in the description, I don't think the fact the dataset is 2D is relevant. I can provide 3D dataset that behaves the same way.
I think the "2D" part of the label relates to the kind of visualisation, i.e. almost everything we do with matplotlib, and is meant to be opposed to "viz: 3D" as in volume rendering. It doesn't say anything about the dimensionality of the data itself. That's how I've been understanding and using it at least.
Turns out it's a frontend problem after all...

Resolving patch:
diff --git a/yt/frontends/gdf/data_structures.py b/yt/frontends/gdf/data_structures.py
--- a/yt/frontends/gdf/data_structures.py
+++ b/yt/frontends/gdf/data_structures.py
@@ -46,11 +46,6 @@ def _setup_dx(self):
         else:
             LE, RE = self.index.grid_left_edge[id, :], self.index.grid_right_edge[id, :]
             self.dds = np.array((RE - LE) / self.ActiveDimensions)
-        if self.ds.data_software != "piernik":
-            if self.ds.dimensionality < 2:
-                self.dds[1] = 1.0
-            if self.ds.dimensionality < 3:
-                self.dds[2] = 1.0
         self.field_data["dx"], self.field_data["dy"], self.field_data["dz"] = self.dds
         self.dds = self.ds.arr(self.dds, "code_length")
 


Test patch: