当前位置: 首页>>代码示例>>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;未经允许,请勿转载。