Repository: holoviz/holoviews

Issue:
GridMatrix(sort=False) still sorts keys
I'd like to have the X axis of the GridMatrix ordered from left to right as 'H&E', 'Real', then 'Fake', but
```
%%opts RGB   [xaxis=None yaxis=None width=250 height=250]
%%opts Image [xaxis=None yaxis=None width=250 height=250]

imgs = [
    (('H&E','patient'),  hv.RGB(patient_dict[patient]['1'][0])),
    (('Real','patient'), hv.Image(patient_dict[patient]['1'][1])),
    (('Fake','patient'), hv.Image(patient_dict[patient]['1'][2]))
]

grid = hv.GridMatrix(imgs,sort=False,kdims=[' ',' '])

grid.opts(hv.opts.Image(cmap='gray'),
          hv.opts.GridMatrix(xaxis='top', 
                             yaxis='left', 
                             shared_yaxis=False))
```
yields

![image](https://user-images.githubusercontent.com/19787532/52189635-8050f600-27ee-11e9-9d19-479ee54382ec.png)

while 

```
%%opts RGB   [xaxis=None yaxis=None width=250 height=250]
%%opts Image [xaxis=None yaxis=None width=250 height=250]

imgs = [
    (('1. H&E','patient'),  hv.RGB(patient_dict[patient]['1'][0])),
    (('2. Real','patient'), hv.Image(patient_dict[patient]['1'][1])),
    (('3. Fake','patient'), hv.Image(patient_dict[patient]['1'][2]))
]

grid = hv.GridMatrix(imgs,sort=False,kdims=[' ',' '])

grid.opts(hv.opts.Image(cmap='gray'),
          hv.opts.GridMatrix(xaxis='top', 
                             yaxis='left', 
                             shared_yaxis=False))
```
yields

![image](https://user-images.githubusercontent.com/19787532/52189691-dde54280-27ee-11e9-81ce-7bb1eda2c100.png)

and 
```
%%opts RGB   [xaxis=None yaxis=None width=250 height=250]
%%opts Image [xaxis=None yaxis=None width=250 height=250]

imgs = [
    (('3. H&E','patient'),  hv.RGB(patient_dict[patient]['1'][0])),
    (('1. Real','patient'), hv.Image(patient_dict[patient]['1'][1])),
    (('2. Fake','patient'), hv.Image(patient_dict[patient]['1'][2]))
]

grid = hv.GridMatrix(imgs,sort=False,kdims=[' ',' '])

grid.opts(hv.opts.Image(cmap='gray'),
          hv.opts.GridMatrix(xaxis='top', 
                             yaxis='left', 
                             shared_yaxis=False))
```
yields

![image](https://user-images.githubusercontent.com/19787532/52189729-1d139380-27ef-11e9-94de-fb22b1c39848.png)

`grid.sort` returns `False` but `grid.info` returns 
```
GridMatrix containing 3 items of type RGB
-----------------------------------------

Key Dimensions: 
	  : Fake...Real 
	  : Fake...Real 
Deep Dimensions: 
	 x: -0.5...0.5 
	 y: -0.5...0.5 
	 R: 0...1 
	 G: 0...1 
	 B: 0...1 
```
indicating that the `Key Dimensions` have been sorted in an unwanted order that is reflected when the GridMatrix is displayed.

Perhaps I've missed something, but I just can't resolve this issue.

Thanks in advance.


Discussion:
I think this is a genuine bug.

Resolving patch:
diff --git a/holoviews/core/spaces.py b/holoviews/core/spaces.py
--- a/holoviews/core/spaces.py
+++ b/holoviews/core/spaces.py
@@ -1903,8 +1903,8 @@ def keys(self, full_grid=False):
         keys = super(GridSpace, self).keys()
         if self.ndims == 1 or not full_grid:
             return keys
-        dim1_keys = sorted(set(k[0] for k in keys))
-        dim2_keys = sorted(set(k[1] for k in keys))
+        dim1_keys = list(OrderedDict.fromkeys(k[0] for k in keys))
+        dim2_keys = list(OrderedDict.fromkeys(k[1] for k in keys))
         return [(d1, d2) for d1 in dim1_keys for d2 in dim2_keys]
 
 
diff --git a/holoviews/plotting/mpl/raster.py b/holoviews/plotting/mpl/raster.py
--- a/holoviews/plotting/mpl/raster.py
+++ b/holoviews/plotting/mpl/raster.py
@@ -233,12 +233,13 @@ def __init__(self, layout, keys=None, dimensions=None, create_axes=False, ranges
         self.overlaid = False
         self.hmap = layout
         if layout.ndims > 1:
-            xkeys, ykeys = zip(*layout.data.keys())
+            xkeys, ykeys = zip(*layout.keys())
         else:
             xkeys = layout.keys()
             ykeys = [None]
-        self._xkeys = sorted(set(xkeys))
-        self._ykeys = sorted(set(ykeys))
+        self._xkeys = list(dict.fromkeys(xkeys))
+        self._ykeys = list(dict.fromkeys(ykeys))
+        
         self._xticks, self._yticks = [], []
         self.rows, self.cols = layout.shape
         self.fig_inches = self._get_size()


Test patch: