当前位置: 首页>>代码示例>>Python>>正文


Python holoviews.Layout方法代码示例

本文整理汇总了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) 
开发者ID:holoviz,项目名称:hvplot,代码行数:9,代码来源:__init__.py

示例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))])) 
开发者ID:holoviz,项目名称:holoviews,代码行数:9,代码来源:testdynamic.py

示例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') 
开发者ID:holoviz,项目名称:holoviews,代码行数:11,代码来源:testdynamic.py

示例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) 
开发者ID:holoviz,项目名称:holoviews,代码行数:4,代码来源:testlayouts.py

示例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) 
开发者ID:holoviz,项目名称:holoviews,代码行数:6,代码来源:testlayouts.py

示例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')]) 
开发者ID:holoviz,项目名称:holoviews,代码行数:6,代码来源:testcomposites.py

示例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]) 
开发者ID:holoviz,项目名称:holoviews,代码行数:5,代码来源:testcomposites.py

示例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')]) 
开发者ID:holoviz,项目名称:holoviews,代码行数:5,代码来源:testcomposites.py

示例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')]) 
开发者ID:holoviz,项目名称:holoviews,代码行数:5,代码来源:testcomposites.py

示例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')]) 
开发者ID:holoviz,项目名称:holoviews,代码行数:6,代码来源:testcomposites.py

示例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')]) 
开发者ID:holoviz,项目名称:holoviews,代码行数:8,代码来源:testcomposites.py

示例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')]) 
开发者ID:holoviz,项目名称:holoviews,代码行数:6,代码来源:testcomposites.py

示例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')]) 
开发者ID:holoviz,项目名称:holoviews,代码行数:6,代码来源:testcomposites.py

示例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])) 
开发者ID:holoviz,项目名称:holoviews,代码行数:5,代码来源:testcomposites.py

示例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])) 
开发者ID:holoviz,项目名称:holoviews,代码行数:5,代码来源:testcomposites.py


注:本文中的holoviews.Layout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。