Skip to content

Commit

Permalink
Merge pull request #1223 from ioam/quadmesh_construct
Browse files Browse the repository at this point in the history
Allow casting from GridImage to QuadMesh
  • Loading branch information
jlstevens committed Mar 23, 2017
2 parents 07ab51e + a4354ab commit ea02488
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions holoviews/element/raster.py
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 ea02488

Please sign in to comment.