예제 #1
0
 def test_label_categorical_color_op(self):
     labels = Labels([(0, 0, 'A'), (0, 1, 'B'), (0, 2, 'A')],
                     vdims='color').options(color='color', cmap='tab10')
     plot = mpl_renderer.get_plot(labels)
     artist = plot.handles['artist']
     self.assertEqual([rgb2hex(a.get_color()) for a in artist],
                      ['#1f77b4', '#ff7f0e', '#1f77b4'])
예제 #2
0
 def test_label_linear_color_op(self):
     labels = Labels([(0, 0, 0), (0, 1, 1), (0, 2, 2)],
                     vdims='color').options(color='color')
     plot = mpl_renderer.get_plot(labels)
     artist = plot.handles['artist']
     self.assertEqual([rgb2hex(a.get_color()) for a in artist],
                      ['#440154', '#20908c', '#fde724'])
예제 #3
0
 def test_cyclic_palette_curves(self):
     palette = Palette('Set1')
     opts = dict(color=palette)
     hmap = HoloMap({i: NdOverlay({j: Curve(np.random.rand(3)).opts(style=opts)
                                   for j in range(3)})
                     for i in range(3)})
     colors = palette[3].values
     plot = bokeh_renderer.get_plot(hmap)
     for subp, color in zip(plot.subplots.values(), colors):
         color = color if isinstance(color, basestring) else rgb2hex(color)
         self.assertEqual(subp.handles['glyph'].line_color, color)
예제 #4
0
 def test_cyclic_palette_curves(self):
     palette = Palette('Set1')
     opts = dict(color=palette)
     hmap = HoloMap({i: NdOverlay({j: Curve(np.random.rand(3)).opts(style=opts)
                                   for j in range(3)})
                     for i in range(3)})
     colors = palette[3].values
     plot = bokeh_renderer.get_plot(hmap)
     for subp, color in zip(plot.subplots.values(), colors):
         color = color if isinstance(color, basestring) else rgb2hex(color)
         self.assertEqual(subp.handles['glyph'].line_color, color)