Пример #1
0
    def test_detailed_plot(self):
        '''
		Test the capability of plotting a simple scatter plot to compare estimate vs truth
		'''
        from matplotlib import pyplot as plt

        output_file = os.path.join(self.out_dir, 'validation_plot2.png')
        _, ax = plt.subplots(1, 1)

        try:
            mean = [0, 0]
            cov = [[1, 0.95], [0.95, 1]]  # diagonal covariance
            x, y = np.random.multivariate_normal(mean, cov, 5000).T
            gs.validation_plot(x,
                               y,
                               vlim=(-3.5, 3.5),
                               grid=True,
                               stat_xy=(1, 0.68),
                               output_file=output_file)
            gs.validation_plot(x,
                               y,
                               vlim=(-3.5, 3.5),
                               grid=True,
                               stat_xy=(1, 0.68),
                               output_file=output_file,
                               ax=ax)

        except Exception as ex:
            self.fail('Unable to test the validation_plot \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 scatter plot to compare estimate vs truth
		'''
        from matplotlib import pyplot as plt

        output_file = os.path.join(self.out_dir, 'validation_plot1.png')
        _, ax = plt.subplots(1, 1)

        try:
            data = gs.ExampleData('3d_estimate')
            _ = gs.validation_plot(data.data['Estimate'],
                                   data.data['True'],
                                   stat_blk='minimal',
                                   output_file=output_file)
            _ = gs.validation_plot(data.data['Estimate'],
                                   data.data['True'],
                                   stat_blk='minimal',
                                   output_file=output_file,
                                   ax=ax)

        except Exception as ex:
            self.fail(
                'Unable to test the validation_plot with simple settings\n{}'.
                format(str(ex)))

        self.assertEqual(os.path.isfile(output_file), True)
Пример #3
0
import pygeostat as gs
data = gs.ExampleData('3d_estimate')
gs.validation_plot(data.data['Estimate'],
                   data.data['True'],
                   stat_blk='minimal')
Пример #4
0
import pygeostat as gs
import numpy as np
mean = [0, 0]
cov = [[1, 0.8], [0.8, 1]]  # diagonal covariance
x, y = np.random.multivariate_normal(mean, cov, 5000).T
gs.validation_plot(x,y,vlim=(-3.5, 3.5) ,grid=True, stat_xy=(1, 0.68))