def test_simple_lower_matrix(self): ''' Test the capability of plotting lower part of a simple correlation matrix ''' from matplotlib import pyplot as plt output_file = os.path.join(self.out_dir, 'correlation_matrix_plot2.png') _, ax = plt.subplots(1, 1) try: gs.correlation_matrix_plot(self.data_cor, lower_matrix=True, annotation=True, output_file=output_file) gs.correlation_matrix_plot(self.data_cor, lower_matrix=True, annotation=True, output_file=output_file, ax=ax) except Exception as ex: self.fail( 'Unable to test the correlation matrix plot with only lower matrix option\n{}' .format(str(ex))) self.assertEqual(os.path.isfile(output_file), True)
def test_simple_plot(self): ''' Test the capability of plotting a simple correlation matrix ''' output_file = os.path.join(self.out_dir, 'correlation_matrix_plot1.png') try: gs.correlation_matrix_plot(self.data_cor, output_file=output_file) except Exception as ex: self.fail('Unable to test the correlation matrix plot \n{}'.format( str(ex))) self.assertEqual(os.path.isfile(output_file), True)
import pygeostat as gs data_file = gs.ExampleData("point3d_ind_mv") data = data_file[data_file.variables] data_cor = data.corr() gs.correlation_matrix_plot(data_cor.values, cmap='bwr')
import pygeostat as gs data_file = gs.ExampleData("point3d_ind_mv") data = data_file[data_file.variables] data_cor = data.corr() gs.correlation_matrix_plot(data_cor, lower_matrix=True, annotation=True)