Exemplo n.º 1
0
    def errorbars(self, _files, _key, **kwargs):
        pt = PlotTool(kwargs)

        for file in _files:
            csv = CSV(file)
            y = csv.getNumericColumnWithKey(_key)
            yStd = csv.getNumericColumnWithKey(_key + "_std")
            x = np.arange(1, len(csv.data) + 1) * 100

            plt.errorbar(x, y, yerr=yStd, capsize=7)

        pt.finalize(kwargs)
Exemplo n.º 2
0
    def scatter(self, _files, _keyX, _keyY, **kwargs):
        pt = PlotTool(kwargs)

        for file in _files:
            csv = CSV(file)
            X = csv.getNumericColumnWithKey(_keyX)
            Y = csv.getNumericColumnWithKey(_keyY)

            plt.scatter(X, Y, marker="*", c="blue")
        pt.finalize(kwargs)
Exemplo n.º 3
0
    def boxplots(self, _files, _key, _xTickLabels, **kwargs):
        Y = []
        for file in _files:
            csv = CSV(file)
            y = csv.getNumericColumnWithKey(_key)
            Y.append(y)

        pt = PlotTool(kwargs)
        pt.boxplot(Y, _xTickLabels)
        pt.finalize(kwargs)
Exemplo n.º 4
0
    def readAsMatrix(self, _file, _key, _sX, _sY):
        csv = CSV(_file)
        M = np.zeros((_sY, _sX))
        Y = csv.getNumericColumnWithKey(_key)

        for x in range(_sX):
            for y in range(_sY):
                v = Y[x * _sY + y]
                if v == -1:
                    v = None

                M[y][x] = v
        return M