import numpy as np import holoviews as hv from holoviews import opts hv.extension('bokeh') hv.Path({'x': [1, 2, 3, 4, 5], 'y': [0, 0, 1, 1, 2]}, ['x', 'y']) p = hv.Path([{'x': [1, 2, 3, 4, 5], 'y': [0, 0, 1, 1, 2], 'value': 0}, {'x': [5, 4, 3, 2, 1], 'y': [2, 2, 1, 1, 0], 'value': 1}], vdims='value').opts(color='value') p hv.Path([{'x': [1, 2, 3, 4, 5, np.nan, 5, 4, 3, 2, 1], 'y': [0, 0, 1, 1, 2, np.nan, 2, 2, 1, 1, 0], 'value': 0}], vdims='value').opts(color='value') a, b, delta = 3, 5, np.pi/2. vs = np.linspace(0, np.pi*2, 200) xs = np.sin(a * vs + delta) ys = np.sin(b * vs) hv.Path([{'x': xs, 'y': ys, 'value': vs}], vdims='value').opts( color='value', cmap='hsv') hv.Contours([{'x': xs, 'y': ys, 'value': np.ones(200)}], vdims='value').opts(color='value') xs = [1, 2, 3] ys = [2, 0, 7] holes = [[[(1.5, 2), (2, 3), (1.6, 1.6)], [(2.1, 4.5), (2.5, 5), (2.3, 3.5)]]] hv.Polygons([{'x': xs, 'y': ys, 'holes': holes}]) xs = [1, 2, 3, np.nan, 6, 7, 3] ys = [2, 0, 7, np.nan, 7, 5, 2] holes = [ [[(1.5, 2), (2, 3), (1.6, 1.6)], [(2.1, 4.5), (2.5, 5), (2.3, 3.5)]], [] ] hv.Polygons([{'x': xs, 'y': ys, 'holes': holes}]) hv.Polygons([{'x': xs, 'y': ys, 'holes': holes, 'value': 0}, {'x': [4, 6, 6], 'y': [0, 2, 1], 'value': 1}, {'x': [-3, -1, -6], 'y': [3, 2, 1], 'value': 3}], vdims='value') poly = hv.Polygons([ {'x': xs, 'y': ys, 'holes': holes, 'value': 0}, {'x': [4, 6, 6], 'y': [0, 2, 1], 'value': 1} ], vdims='value') hv.Layout(poly.split()) poly.split(datatype='dictionary')