From 56f26248ddc0c3dd16ad1c3420410a0faa9b9751 Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Wed, 12 Apr 2017 14:03:09 +0100
Subject: [PATCH] Allow casting Image to QuadMesh
---
holoviews/element/raster.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/holoviews/element/raster.py b/holoviews/element/raster.py
index 8e1fc421d0..a09c952da8 100644
--- a/holoviews/element/raster.py
+++ b/holoviews/element/raster.py
@@ -569,8 +569,13 @@ def depth(self): return 1
def _process_data(self, data):
- data = tuple(np.array(el) for el in data)
- x, y, zarray = data
+ if isinstance(data, Image):
+ x = data.dimension_values(0, expanded=False)
+ y = data.dimension_values(1, expanded=False)
+ zarray = data.dimension_values(2, flat=False)
+ else:
+ data = tuple(np.array(el) for el in data)
+ x, y, zarray = data
ys, xs = zarray.shape
if x.ndim == 1 and len(x) == xs:
x = compute_edges(x)