def _plot_concat(self): """Plot all lines on a single figure""" pivot_vals, _ = self.c_mgr.generate_pivots() plot_index = 0 self._layout = ILinePlotGen(len(self.c_mgr), **self._attr) for constraint in self.c_mgr: result = constraint.result title = str(constraint) data_dict = OrderedDict() for pivot in pivot_vals: if pivot in result: if pivot == AttrConf.PIVOT_VAL: key = ",".join(self._attr["column"]) else: key = "{0}: {1}".format( self._attr["pivot"], self._attr["map_label"].get(pivot, pivot)) data_dict[key] = result[pivot] if len(data_dict) > 1: data_frame = self._fix_indexes(data_dict) else: data_frame = pd.DataFrame(data_dict) self._layout.add_plot(plot_index, data_frame, title) plot_index += 1 self._layout.finish()
def _plot(self, permute): """Internal Method called to draw the plot""" pivot_vals, len_pivots = self.c_mgr.generate_pivots(permute) self._layout = ILinePlotGen(self._attr["per_line"], len_pivots, **self._attr) plot_index = 0 for p_val in pivot_vals: data_frame = pd.Series() for constraint in self.c_mgr: if permute: run_idx, pivot = p_val if constraint.run_index != run_idx: continue title = constraint.get_data_name() + ":" legend = constraint._column else: pivot = p_val title = "" legend = str(constraint) result = constraint.result if pivot in result: data_frame[legend] = result[pivot] if pivot == AttrConf.PIVOT_VAL: title += ",".join(self._attr["column"]) else: title += "{0}: {1}".format(self._attr["pivot"], pivot) self._layout.add_plot(plot_index, data_frame, title) plot_index += 1 self._layout.finish()
def _plot(self, permute, test): """Internal Method called to draw the plot""" pivot_vals, len_pivots = self.c_mgr.generate_pivots(permute) self._layout = ILinePlotGen(len_pivots, **self._attr) plot_index = 0 for p_val in pivot_vals: data_dict = OrderedDict() for constraint in self.c_mgr: if permute: trace_idx, pivot = p_val if constraint.trace_index != trace_idx: continue legend = constraint._template.name + ":" + constraint.column else: pivot = p_val legend = str(constraint) result = constraint.result if pivot in result: data_dict[legend] = result[pivot] if permute: title = self.traces[plot_index].name elif pivot != AttrConf.PIVOT_VAL: title = "{0}: {1}".format(self._attr["pivot"], self._attr["map_label"].get(pivot, pivot)) else: title = "" # Fix data frame indexes if necessary data_dict = self._fix_indexes(data_dict) self._layout.add_plot(plot_index, data_dict, title, test=test) plot_index += 1 self._layout.finish()
def _plot_concat(self): """Plot all lines on a single figure""" pivot_vals, _ = self.c_mgr.generate_pivots() plot_index = 0 self._layout = ILinePlotGen(self._attr["per_line"], len(self.c_mgr), **self._attr) for constraint in self.c_mgr: result = constraint.result title = str(constraint) data_frame = pd.Series() for pivot in pivot_vals: if pivot in result: if pivot == AttrConf.PIVOT_VAL: key = ",".join(self._attr["column"]) else: key = "{0}: {1}".format(self._attr["pivot"], pivot) data_frame[key] = result[pivot] self._layout.add_plot(plot_index, data_frame, title) plot_index += 1 self._layout.finish()