import numpy as np import holoviews as hv from holoviews import opts hv.extension('matplotlib') np.random.seed(9) data = np.random.rand(10, 2) points = hv.Points(data) labels = hv.Labels({('x', 'y'): data, 'text': [chr(65+i) for i in range(10)]}, ['x', 'y'], 'text') (points* labels).opts( opts.Labels(color='text', cmap='Category20', xoffset=0.05, yoffset=0.05, size=14, padding=0.2), opts.Points(color='black', s=25)) value_dimension = hv.Dimension('Values', value_format=lambda x: '%.1f' % x) xs = ys = np.linspace(-2.5, 2.5, 25) zs = np.sin(xs**2)*np.sin(ys**2)[:, np.newaxis] hv.Labels((xs, ys, zs), vdims=value_dimension).opts( opts.Labels(bgcolor='black', cmap='viridis', color='Values', fig_size=200, padding=0.05, size=8))