Exemplo n.º 1
0
 def test_plot_options_keywords(self):
     im = Image(np.random.rand(10, 10))
     styled_im = im.options(interpolation='nearest', cmap='jet')
     self.assertEqual(self.lookup_options(im, 'plot').options, {})
     self.assertEqual(
         self.lookup_options(styled_im, 'style').options,
         dict(cmap='jet', interpolation='nearest'))
Exemplo n.º 2
0
 def test_plot_options_one_object(self):
     im = Image(np.random.rand(10,10))
     imopts = opts.Image(interpolation='nearest', cmap='jet')
     styled_im = im.options(imopts)
     self.assertEqual(self.lookup_options(im, 'plot').options, {})
     self.assertEqual(self.lookup_options(styled_im, 'style').options,
                      dict(cmap='jet', interpolation='nearest'))
Exemplo n.º 3
0
 def test_plot_options_object_list(self):
     im = Image(np.random.rand(10,10))
     imopts1 = opts.Image(interpolation='nearest')
     imopts2 = opts.Image(cmap='summer')
     styled_im = im.options([imopts1,imopts2])
     self.assertEqual(self.lookup_options(im, 'plot').options, {})
     self.assertEqual(self.lookup_options(styled_im, 'style').options,
                      dict(cmap='summer', interpolation='nearest'))
Exemplo n.º 4
0
 def test_plot_options_object_list(self):
     im = Image(np.random.rand(10,10))
     imopts1 = opts.Image(interpolation='nearest')
     imopts2 = opts.Image(cmap='summer')
     styled_im = im.options([imopts1,imopts2])
     self.assertEqual(self.lookup_options(im, 'plot').options, {})
     self.assertEqual(self.lookup_options(styled_im, 'style').options,
                      dict(cmap='summer', interpolation='nearest'))