本文整理汇总了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)
示例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)
示例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')
示例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'})
示例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)
示例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'})
示例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()