Skip to content

Commit

Permalink
Allow casting from GridImage to QuadMesh
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 23, 2017
1 parent e30f9a2 commit a4354ab
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 @@ -243,8 +243,13 @@ def __init__(self, data, **params):
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, GridImage):
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 a4354ab

Please sign in to comment.