示例#1
0
    def do_plot(self, line):
        keys = matchItems(line, self.summaryKeys())

        if len(keys) == 0:
            self.lastCommandFailed("Must have at least one Summary key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            plot = ShellPlot(key)
            for case_name in case_list:
                data = SummaryCollector.loadAllSummaryData(
                    self.ert(), case_name, [key])
                if not data.empty:
                    plot.plot(data, value_column=key, legend_label=case_name)

            if len(
                    case_list
            ) > 0 and SummaryObservationCollector.summaryKeyHasObservations(
                    self.ert(), key):
                observation_data = SummaryObservationCollector.loadObservationData(
                    self.ert(), case_list[0], [key])

                if not observation_data.empty:
                    plot.plotObservations(observation_data, value_column=key)

            plot.showLegend()
示例#2
0
    def do_plot_area(self, line):
        keys = matchItems(line, self.summaryKeys())

        if len(keys) == 0:
            print("Error: Must have at least one Summary key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            plot = ShellPlot(key)
            for case_name in case_list:
                data = SummaryCollector.loadAllSummaryData(self.ert(), case_name, [key])
                plot.plotArea(data, value_column=key, legend_label=case_name)

            if len(case_list) > 0 and SummaryObservationCollector.summaryKeyHasObservations(self.ert(), key):
                observation_data = SummaryObservationCollector.loadObservationData(self.ert(), case_list[0], [key])
                plot.plotObservations(observation_data, value_column=key)

            plot.showLegend()