def _make_correlation(self, idx, ytitle): fi = self.figures[0] plots = list(fi.options.get_plotable_aux_plots()) tag = plots[idx].plot_name n = len(self.figures) r, c = filled_grid(n) g = RegressionGraph(container_dict={ 'kind': 'g', 'shape': (r, c) }, window_title='Correlation') for i, fi in enumerate(self.figures): gi = fi.analysis_group p = g.new_plot(xtitle='age', ytitle=ytitle, title='{}({})'.format(gi.sample, gi.identifier)) xs = [nominal_value(a.uage) for a in gi.clean_analyses()] ys = [nominal_value(a.get_value(tag)) for a in gi.clean_analyses()] g.new_series(xs, ys, fit='linear', use_error_envelope=False, plotid=i) g.add_correlation_statistics(plotid=i) g.set_x_limits(pad='0.1', plotid=i) g.set_y_limits(pad='0.1', plotid=i) g.refresh() open_view(g)
def _make_correlation(self, refplot, xtitle): fi = self.figures[0] n = len(list(fi.options.get_plotable_aux_plots())) plots = list(reversed(fi.graph.plots)) xs = refplot.data.get_data('y1') r, c = filled_grid(n - 1) g = RegressionGraph(container_dict={ 'kind': 'g', 'shape': (r, c) }, window_title='Correlation') i = 0 for pp in plots: ytitle = pp.y_axis.title if ytitle == xtitle: continue g.new_plot(xtitle=xtitle, ytitle=ytitle, padding=[80, 10, 10, 40]) ys = pp.data.get_data('y1') g.new_series(xs, ys, fit='linear', use_error_envelope=False, plotid=i) g.add_correlation_statistics(plotid=i) g.set_x_limits(pad='0.1', plotid=i) g.set_y_limits(pad='0.1', plotid=i) i += 1 g.refresh() open_view(g)