示例#1
0
    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)
示例#2
0
    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)
示例#3
0
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')
示例#4
0
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)