def plot_parent_coding_hist(self, fhand): fig = Figure() axes = fig.add_subplot(111) axes.hist(self.indexes, fill=True, log=True, bins=20, rwidth=1) axes.axvline(x=self.parent_index_threshold) axes.set_xlabel('support index for parental coding') axes.set_ylabel('num. SNPs') _print_figure(axes, fig, fhand, plot_legend=False)
def draw_hist(self, fhand): fig = Figure() axes = fig.add_subplot(111) axes.hist(self._scores, fill=True, log=True, bins=20, rwidth=1) axes.axvline(x=self.threshold) axes.set_xlabel('% complexity score') axes.set_ylabel('num. SNPs') _print_figure(axes, fig, fhand, plot_legend=False)
def plot_smooth_hist(self, fhand): bins = 20 fig = Figure() axes2 = fig.add_subplot(111) x = self._smoothes y = self._recombs image = axes2.hist2d(x, y, bins=bins, norm=LogNorm())[-1] axes2.tick_params( which='both', # both major and minor ticks are affected bottom='off', # ticks along the bottom edge are off top='off', # ticks along the top edge are off labelbottom='off', right='off', left='off', labelleft='off') xmin2d, xmax2d = axes2.get_xlim() ymin2d, ymax2d = axes2.get_ylim() axes2.vlines(self.smooth_threhsold, ymin2d, ymax2d, color='r') if self.recomb_threshold is not None: axes2.hlines(self.recomb_threshold, xmin2d, xmax2d, color='r') divider = make_axes_locatable(axes2) cax = divider.append_axes("right", size="5%", pad=0.05) fig.colorbar(image, cax=cax) axes = divider.append_axes('bottom', size=2, pad=0.1, sharex=axes2) #axes = fig.add_subplot(224) #print axes2.get_position().bounds axes.hist(x, fill=True, log=True, bins=bins, rwidth=1) axes.set_xlabel('Smooth index') axes.set_ylabel('Num. SNPs') axes.set_xlim(xmin2d, xmax2d) ymin, ymax = axes.get_ylim() axes.vlines(self.smooth_threhsold, ymin, ymax, color='r') axes = divider.append_axes('left', size=2, pad=0.1, sharey=axes2) #axes = fig.add_subplot(221) axes.hist(y, orientation='horizontal', fill=True, log=True, bins=bins, rwidth=1) axes.set_ylabel('Num. recombs.') axes.set_xlabel('Num. SNPs') _print_figure(axes, fig, fhand, plot_legend=False) axes.set_ylim(ymin2d, ymax2d) xmin, xmax = axes.get_xlim() if self.recomb_threshold is not None: axes.hlines(self.recomb_threshold, xmin, xmax, color='r')