예제 #1
0
    def test_density_plot(self):
        values = np.array([0, -15, 2, 3, 15, 8, 5, 3, 9, 11, 12, 1, 7, 7, 6])
        reference_values = np.array([-9, 10, 1, 2, 11, 3, 7, 5, 4, 12, 7, 8, 5, 1, 14])

        diagram = plotter.create_density_plot(reference_values, values, 'Modelled_toads', 'Toads', 'kg')

        diagram.write('resources/density_test.png')
예제 #2
0
    def test_density_plot(self):
        values = np.array([0, -15, 2, 3, 15, 8, 5, 3, 9, 11, 12, 1, 7, 7, 6])
        reference_values = np.array(
            [-9, 10, 1, 2, 11, 3, 7, 5, 4, 12, 7, 8, 5, 1, 14])

        diagram = plotter.create_density_plot(reference_values, values,
                                              'Modelled_toads', 'Toads', 'kg')

        diagram.write('resources/density_test.png')
예제 #3
0
파일: output.py 프로젝트: bcdev/opec-tools
    def density_plot(self, model_name, ref_name, model_values, ref_values, log_scaled, target_file=None, axis_min=None, axis_max=None, unit=None):
        if axis_min is None:
            axis_min = min(np.min(ref_values), np.min(model_values))
        if axis_max is None:
            axis_max = max(np.max(ref_values), np.max(model_values))

        density_plot = plotter.create_density_plot(ref_name, model_name, unit)
        density_plot.set_data(ref_values, model_values, axis_min, axis_max, ref_values.size, log_scaled)

        if target_file is not None:
            self.write_density_plot(density_plot, target_file)

        return density_plot
예제 #4
0
    def density_plot(self,
                     model_name,
                     ref_name,
                     model_values,
                     ref_values,
                     log_scaled,
                     target_file=None,
                     axis_min=None,
                     axis_max=None,
                     unit=None):
        if axis_min is None:
            axis_min = min(np.min(ref_values), np.min(model_values))
        if axis_max is None:
            axis_max = max(np.max(ref_values), np.max(model_values))

        density_plot = plotter.create_density_plot(ref_name, model_name, unit)
        density_plot.set_data(ref_values, model_values, axis_min, axis_max,
                              ref_values.size, log_scaled)

        if target_file is not None:
            self.write_density_plot(density_plot, target_file)

        return density_plot