def visualize(self, obj, **kwargs): prot = obj f1 = genfromtxt(prot._getExtraPath('f1.txt')) f2 = genfromtxt(prot._getExtraPath('f2.txt')) plotter = EmPlotter(style='seaborn-whitegrid') plotter.createSubPlot("Histogram of f1", "f1", "Count") plotter.plotHist(f1[~isnan(f1)], 50) plotter.show() plotter = EmPlotter(style='seaborn-whitegrid') plotter.createSubPlot("Histogram of f2", "f2", "Count") plotter.plotHist(f2[~isnan(f2)], 50) plotter.show()
def visualize(self, obj, **kwargs): prot = obj fn = prot._getExtraPath('D11.txt') if os.path.exists(fn): D11 = genfromtxt(fn) plotter = EmPlotter(style='seaborn-whitegrid') plotter.createSubPlot("Histogram of D11", "D11", "Count") plotter.plotHist(D11[~isnan(D11)], 50) plotter.show() fn = prot._getExtraPath('D12.txt') if os.path.exists(fn): D12 = genfromtxt(fn) plotter = EmPlotter(style='seaborn-whitegrid') plotter.createSubPlot("Histogram of D12", "D12", "Count") plotter.plotHist(D12[~isnan(D12)], 50) plotter.show()
def visualize(self, obj, **kwargs): prot = obj auc = np.genfromtxt(prot._getExtraPath('errorAUC.txt')) cmax = np.genfromtxt(prot._getExtraPath('errorCmax.txt')) plotter = EmPlotter(style='seaborn-whitegrid') plotter.createSubPlot("Histogram of error AUC0t", "Error AUC0t", "Count") plotter.plotHist(auc[~np.isnan(auc)], 50) plotter.show() plotter = EmPlotter(style='seaborn-whitegrid') plotter.createSubPlot("Histogram of error Cmax", "Error Cmax", "Count") plotter.plotHist(cmax[~np.isnan(cmax)], 50) plotter.show() sortedTimeTrue, Ytrue = self.getSummary(prot.inputExperiment.get().fnPKPD) sortedTimeSimulated, Ysimulated = self.getSummary(prot.inputSimulated.get().fnPKPD) plotter = EmPlotter(style='seaborn-whitegrid') ax = plotter.createSubPlot("Summary Plot", self.timeVarName, self.CVarName) ax.plot(sortedTimeTrue, Ytrue[:, 0], 'r--', label="Minimum In-vivo", linewidth=2) ax.plot(sortedTimeTrue, Ytrue[:, 1], 'b--', label="25% In-vivo", linewidth=2) ax.plot(sortedTimeTrue, Ytrue[:, 2], 'g', label="50% (Median) In-vivo", linewidth=2) ax.plot(sortedTimeTrue, Ytrue[:, 3], 'b--', label="75% In-vivo", linewidth=2) ax.plot(sortedTimeTrue, Ytrue[:, 4], 'r--', label="Maximum In-vivo", linewidth=2) ax.plot(sortedTimeSimulated, Ysimulated[:, 0], 'r--', label="Minimum Simulated") ax.plot(sortedTimeSimulated, Ysimulated[:, 1], 'b--', label="25% Simulated") ax.plot(sortedTimeSimulated, Ysimulated[:, 2], 'g', label="50% (Median) Simulated") ax.plot(sortedTimeSimulated, Ysimulated[:, 3], 'b--', label="75% Simulated") ax.plot(sortedTimeSimulated, Ysimulated[:, 4], 'r--', label="Maximum Simulated") ax.grid(True) ax.legend() plotter.show() plotter = EmPlotter(style='seaborn-whitegrid') ax = plotter.createSubPlot("Mean Plot", self.timeVarName, self.CVarName) ax.plot(sortedTimeTrue, Ytrue[:, 2], 'g', label="50% (Median) In-vivo", linewidth=2) ax.plot(sortedTimeSimulated, Ysimulated[:, 2], 'g', label="50% (Median) Simulated") ax.grid(True) ax.legend() plotter.show()
def _onPlotClick(self, e=None): selection = self.tree.selection() n = len(selection) if n < 1 or n > 2: self.showError("Select one or two variables to plot.") else: plotter = EmPlotter(style='seaborn-whitegrid') varX = self._variables[selection[0]] xValues = self.observations[:, varX.index] def _label(var): return "%s [%s]" % (var.varName, var.unitStr) if n == 1: plotter.createSubPlot("Histogram", _label(varX), "Count") plotter.plotHist(xValues, 50) else: # n == 2 varY = self._variables[selection[1]] yValues = self.observations[:, varY.index] ax = plotter.createSubPlot("Scatter Plot", _label(varX), _label(varY)) ax.plot(xValues, yValues, '.') plotter.show()