本文整理汇总了Python中holoviews.Layout方法的典型用法代码示例。如果您正苦于以下问题:Python holoviews.Layout方法的具体用法?Python holoviews.Layout怎么用?Python holoviews.Layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类holoviews
的用法示例。
在下文中一共展示了holoviews.Layout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: boxplot_frame_groupby
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def boxplot_frame_groupby(grouped, **kwargs):
width = kwargs.pop('width', 300)
subplots = kwargs.pop('subplots', True)
layout = hv.Layout if subplots else hv.Overlay
plots = [plot(data=data, kind='box', title=name, width=width, **kwargs)
for name, data in grouped]
return layout(plots)
示例2: test_deep_map_apply_dmap_function
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_deep_map_apply_dmap_function(self):
fn = lambda i: Curve(np.arange(i))
dmap1 = DynamicMap(fn, kdims=[Dimension('Test', range=(10, 20))])
dmap2 = DynamicMap(fn, kdims=[Dimension('Test', range=(10, 20))])
mapped = (dmap1 + dmap2).map(lambda x: x[10], DynamicMap)
self.assertEqual(mapped, Layout([('DynamicMap.I', fn(10)),
('DynamicMap.II', fn(10))]))
示例3: test_dynamic_collate_layout_with_changing_label
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_dynamic_collate_layout_with_changing_label(self):
def callback(i):
return Layout([Curve([], label=str(j)) for j in range(i, i+2)])
dmap = DynamicMap(callback, kdims=['i']).redim.range(i=(0, 10))
layout = dmap.collate()
dmap1, dmap2 = layout.values()
el1, el2 = dmap1[2], dmap2[2]
self.assertEqual(el1.label, '2')
self.assertEqual(el2.label, '3')
示例4: test_add_operator
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_add_operator(self):
self.assertEqual(type(self.view1 + self.view2), Layout)
示例5: test_adjointlayout_add_operator
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_adjointlayout_add_operator(self):
layout1 = self.view3 << self.view2
layout2 = self.view2 << self.view1
self.assertEqual(type(layout1 + layout2), Layout)
示例6: test_layouttree_keys_2
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layouttree_keys_2(self):
t = Layout([self.el1, self.el2])
self.assertEqual(t.keys(),
[('Element', 'I'), ('Element', 'II')])
示例7: test_layouttree_values_2
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layouttree_values_2(self):
t = Layout([self.el1, self.el2])
self.assertEqual(t.values(), [self.el1, self.el2])
示例8: test_layouttree_constructor1
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layouttree_constructor1(self):
t = Layout([self.el1])
self.assertEqual(t.keys(), [('Element', 'I')])
示例9: test_layouttree_constructor2
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layouttree_constructor2(self):
t = Layout([self.el8])
self.assertEqual(t.keys(), [('ValA', 'LabelB')])
示例10: test_layouttree_group
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layouttree_group(self):
t1 = (self.el1 + self.el2)
t2 = Layout(list(t1.relabel(group='NewValue')))
self.assertEqual(t2.keys(), [('NewValue', 'I'), ('NewValue', 'II')])
示例11: test_layout_constructor_with_layouts
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layout_constructor_with_layouts(self):
layout1 = self.el1 + self.el4
layout2 = self.el2 + self.el5
paths = Layout([layout1, layout2]).keys()
self.assertEqual(paths, [('Element', 'I'), ('ValA', 'I'),
('Element', 'II'), ('ValB', 'I')])
示例12: test_layout_constructor_retains_custom_path
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layout_constructor_retains_custom_path(self):
layout = Layout([('Custom', self.el1)])
paths = Layout([layout, self.el2]).keys()
self.assertEqual(paths, [('Custom', 'I'), ('Element', 'I')])
示例13: test_layout_constructor_retains_custom_path_with_label
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layout_constructor_retains_custom_path_with_label(self):
layout = Layout([('Custom', self.el6)])
paths = Layout([layout, self.el2]).keys()
self.assertEqual(paths, [('Custom', 'LabelA'), ('Element', 'I')])
示例14: test_layout_overlay_element
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layout_overlay_element(self):
t = (self.el1 + self.el2) * self.el3
self.assertEqual(t, Layout([self.el1*self.el3, self.el2*self.el3]))
示例15: test_layout_overlay_element_reverse
# 需要导入模块: import holoviews [as 别名]
# 或者: from holoviews import Layout [as 别名]
def test_layout_overlay_element_reverse(self):
t = self.el3 * (self.el1 + self.el2)
self.assertEqual(t, Layout([self.el3*self.el1, self.el3*self.el2]))