當前位置: 首頁>>代碼示例>>Python>>正文


Python Store.custom_options方法代碼示例

本文整理匯總了Python中holoviews.core.options.Store.custom_options方法的典型用法代碼示例。如果您正苦於以下問題:Python Store.custom_options方法的具體用法?Python Store.custom_options怎麽用?Python Store.custom_options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在holoviews.core.options.Store的用法示例。


在下文中一共展示了Store.custom_options方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_cell_opts_plot

# 需要導入模塊: from holoviews.core.options import Store [as 別名]
# 或者: from holoviews.core.options.Store import custom_options [as 別名]
    def test_cell_opts_plot(self):

        self.cell("mat1 = Image(np.random.rand(5,5), name='mat1')")

        self.assertEqual(self.get_object('mat1').id, None)
        self.cell_magic('opts', " Image [show_title=False]", 'mat1')
        self.assertEqual(self.get_object('mat1').id, 0)

        assert 0 in Store.custom_options(), "Custom OptionTree creation failed"
        self.assertEqual(
            Store.lookup_options('matplotlib',
                                 self.get_object('mat1'), 'plot').options.get('show_title',True),False)
開發者ID:RafalSkolasinski,項目名稱:holoviews,代碼行數:14,代碼來源:testmagics.py

示例2: test_cell_opts_norm

# 需要導入模塊: from holoviews.core.options import Store [as 別名]
# 或者: from holoviews.core.options.Store import custom_options [as 別名]
    def test_cell_opts_norm(self):

        self.cell("mat1 = Image(np.random.rand(5,5), name='mat1')")

        self.assertEqual(self.get_object('mat1').id, None)
        self.cell_magic('opts', " Image {+axiswise}", 'mat1')
        self.assertEqual(self.get_object('mat1').id, 0)

        assert 0 in Store.custom_options(), "Custom OptionTree creation failed"
        self.assertEqual(
            Store.lookup_options('matplotlib',
                                 self.get_object('mat1'), 'norm').options.get('axiswise',True), True)
開發者ID:RafalSkolasinski,項目名稱:holoviews,代碼行數:14,代碼來源:testmagics.py

示例3: test_cell_opts_style

# 需要導入模塊: from holoviews.core.options import Store [as 別名]
# 或者: from holoviews.core.options.Store import custom_options [as 別名]
    def test_cell_opts_style(self):

        self.cell("mat1 = Image(np.random.rand(5,5), name='mat1')")

        self.assertEqual(self.get_object('mat1').id, None)
        self.cell_magic('opts', " Image (cmap='hot')", 'mat1')
        self.assertEqual(self.get_object('mat1').id, 0)

        assert 0 in Store.custom_options(), "Custom OptionTree creation failed"
        self.assertEqual(
            Store.lookup_options('matplotlib',
                                 self.get_object('mat1'), 'style').options.get('cmap',None),'hot')
開發者ID:RafalSkolasinski,項目名稱:holoviews,代碼行數:14,代碼來源:testmagics.py

示例4: test_cell_opts_plot_dynamic

# 需要導入模塊: from holoviews.core.options import Store [as 別名]
# 或者: from holoviews.core.options.Store import custom_options [as 別名]
    def test_cell_opts_plot_dynamic(self):

        self.cell("dmap = DynamicMap(lambda X: Image(np.random.rand(5,5), name='dmap'), kdims=['x'])"
                  ".redim.range(x=(0, 10)).opts(plot={'Image': dict(xaxis='top', xticks=3)})")

        self.assertEqual(self.get_object('dmap').id, None)
        self.cell_magic('opts', " Image [xaxis=None yaxis='right']", 'dmap')
        self.assertEqual(self.get_object('dmap').id, 0)

        assert 0 in Store.custom_options(), "Custom OptionTree creation failed"
        opts = Store.lookup_options('matplotlib', self.get_object('dmap')[0], 'plot').options
        self.assertEqual(opts, {'xticks': 3, 'xaxis': None, 'yaxis': 'right'})
開發者ID:mforbes,項目名稱:holoviews,代碼行數:14,代碼來源:testmagics.py

示例5: test_cell_opts_plot_float_division

# 需要導入模塊: from holoviews.core.options import Store [as 別名]
# 或者: from holoviews.core.options.Store import custom_options [as 別名]
    def test_cell_opts_plot_float_division(self):

        self.cell("mat1 = Image(np.random.rand(5,5), name='mat1')")

        self.assertEqual(self.get_object('mat1').id, None)
        self.cell_magic('opts', " Image [aspect=3/4]", 'mat1')
        self.assertEqual(self.get_object('mat1').id, 0)

        assert 0 in Store.custom_options(), "Custom OptionTree creation failed"
        self.assertEqual(
            Store.lookup_options('matplotlib',
                                 self.get_object('mat1'), 'plot').options.get('aspect',False), 3/4.0)
開發者ID:mforbes,項目名稱:holoviews,代碼行數:14,代碼來源:testmagics.py

示例6: test_cell_opts_style_dynamic

# 需要導入模塊: from holoviews.core.options import Store [as 別名]
# 或者: from holoviews.core.options.Store import custom_options [as 別名]
    def test_cell_opts_style_dynamic(self):

        self.cell("dmap = DynamicMap(lambda X: Curve(np.random.rand(5,2), name='dmap'), kdims=['x'])"
                  ".redim.range(x=(0, 10)).opts(style={'Curve': dict(linewidth=2, color='black')})")

        self.assertEqual(self.get_object('dmap').id, None)
        self.cell_magic('opts', " Curve (linewidth=3 alpha=0.5)", 'dmap')
        self.assertEqual(self.get_object('dmap').id, 0)

        assert 0 in Store.custom_options(), "Custom OptionTree creation failed"
        opts = Store.lookup_options('matplotlib', self.get_object('dmap')[0], 'style').options
        self.assertEqual(opts, {'linewidth': 3, 'alpha': 0.5, 'color': 'black'})
開發者ID:mforbes,項目名稱:holoviews,代碼行數:14,代碼來源:testmagics.py

示例7: tearDown

# 需要導入模塊: from holoviews.core.options import Store [as 別名]
# 或者: from holoviews.core.options.Store import custom_options [as 別名]
 def tearDown(self):
     Store.custom_options(val = {})
     super(TestOptsMagic, self).tearDown()
開發者ID:RafalSkolasinski,項目名稱:holoviews,代碼行數:5,代碼來源:testmagics.py


注:本文中的holoviews.core.options.Store.custom_options方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。