Skip to content

Commit

Permalink
Allow casting Image to QuadMesh
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 12, 2017
1 parent 5fd2104 commit 56f2624
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions holoviews/element/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 56f2624

Please sign in to comment.