當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。