Exemple #1
0
    def _plotHistogram(self, param=None):
        md = MetaData()
        md.read(self.protocol._getFileName(FN_METADATA_HISTOGRAM))
        x_axis = []
        y_axis = []

        i = 0
        for idx in md:
            x_axis_ = md.getValue(MDL_X, idx)
            if i == 0:
                x0 = x_axis_
            elif i == 1:
                x1 = x_axis_
            y_axis_ = md.getValue(MDL_COUNT, idx)

            i += 1
            x_axis.append(x_axis_)
            y_axis.append(y_axis_)

        plotter = EmPlotter()
        plotter.createSubPlot("Resolutions Histogram", "Resolution (A)",
                              "# of Counts")

        barwidth = x1 - x0

        plotter.plotDataBar(x_axis, y_axis, barwidth)

        return [plotter]
Exemple #2
0
    def _plotHistogram(self, param=None):
        md = MetaData()
        md.read(self.protocol._getExtraPath(FN_METADATA_HISTOGRAM))
        x_axis = []
        y_axis = []

        for idx in md:
            x_axis_ = md.getValue(MDL_X, idx)
            y_axis_ = md.getValue(MDL_COUNT, idx)

            x_axis.append(x_axis_)
            y_axis.append(y_axis_)

        _plotter = EmPlotter()
        _plotter.createSubPlot("Resolutions Histogram",
                               "Resolution (A)", "# of Counts")
        barwidth = (x_axis[-1] - x_axis[0]) / len(x_axis)

        _plotter.plotDataBar(x_axis[:-2], y_axis[:-2], barwidth)

        return [_plotter]