Example #1
0
    def __overlay_curves(axis, curve_stack):

        plot_line_family(axis, x_vec, curve_stack, label_prefix='Cluster', cmap=cmap)

        if legend_mode == 0:
            axis.legend(loc='best', fontsize=14)
        elif legend_mode == 1:
            axis.legend(loc='upper left', bbox_to_anchor=(1, 1), fontsize=14)
        else:
            sm = make_scalar_mappable(0, num_clusters - 1, cmap=discrete_cmap(num_clusters, cmap))
            plt.colorbar(sm)
Example #2
0
    def __overlay_curves(axis, curve_stack):

        plot_line_family(axis,
                         x_vec,
                         curve_stack,
                         label_prefix='Cluster',
                         cmap=cmap)

        if legend_mode == 0:
            axis.legend(loc='best', fontsize=14)
        elif legend_mode == 1:
            axis.legend(loc='upper left', bbox_to_anchor=(1, 1), fontsize=14)
        else:
            sm = make_scalar_mappable(0,
                                      num_clusters - 1,
                                      cmap=discrete_cmap(num_clusters, cmap))
            plt.colorbar(sm)
Example #3
0
 def test_vmax_not_num(self):
     notNum = 'hello'
     with self.assertRaises(AssertionError):
         plot_utils.make_scalar_mappable(5, notNum)
Example #4
0
 def test_vmin_more_vmax(self):
     with self.assertRaises(AssertionError):
         plot_utils.make_scalar_mappable(5, 3)
Example #5
0
 def test_cmap_not_none_wrong_input(self):
     with self.assertRaises(ValueError):
         plot_utils.make_scalar_mappable(3, 5, cmap='hello')