Example #1
0
 def test_set_colors(self):
     cm = dcs.ColorMap(num_colors=5)
     self.fig = plt.figure()
     ax = self.fig.add_subplot(111)
     cm.set_colors(ax)
     ax.plot(0, 0)
     self.assertTrue(True)
Example #2
0
 def test_set_color_failure(self):
     cm = dcs.ColorMap()
     self.fig = plt.figure()
     ax = self.fig.add_subplot(111)
     ax.plot(0, 0)
     with self.assertRaises(ValueError):
         cm.set_colors(ax)
Example #3
0
 def test_get_smap(self):
     cm = dcs.ColorMap()
     smap = cm.get_smap()
     self.assertTrue(isinstance(smap, cmx.ScalarMappable))
Example #4
0
 def test_get_color(self):
     cm = dcs.ColorMap(num_colors=self.num_colors)
     for i in range(self.num_colors):
         self.assertTrue(cm.get_color(i))
Example #5
0
 def test_no_inputs(self):
     cm = dcs.ColorMap()
     self.assertTrue(cm.get_color(self.low))
Example #6
0
 def test_num_colors(self):
     cm = dcs.ColorMap(self.colormap, num_colors=self.num_colors)
     self.assertTrue(cm.get_color(self.low))
Example #7
0
 def test_nominal(self):
     cm = dcs.ColorMap(self.colormap, self.low, self.high)
     self.assertTrue(cm.get_color(self.low))