def plot_Q(args):
    """Plot Q distribution"""
    outfile = (args.out_params + '_it{iteration}.png').format(param='Q', **args.__dict__)
    print outfile
    I,T,K = args.Q.shape
    I,T,L = args.X.shape
    fig, axs = pyplot.subplots(I+1, 1, sharex=True, sharey=True, squeeze=False)
    for i in xrange(I):
        axs[i,0].plot(args.Q[i,:,:])
    mark_total = args.X.sum(axis=2).T
    axs[I,0].plot(mark_total / float(L))

    fig.suptitle("Q distribution for {approx} at iteration {iteration}".
                    format(approx=args.approx, iteration=args.iteration))
    fig.suptitle("chromosome bin", x=.5, y=.02)
    fig.suptitle("species", x=.02, y=.5, verticalalignment='center', rotation=90)
    #fig.savefig(os.path.join(args.out_dir, 'Q_dist_%s.png' % args.iteration))
    fig.savefig(os.path.join(args.out_dir, outfile))
    pyplot.close('all')
dataset/ETHPy150Open uci-cbcl/tree-hmm/treehmm/plot.py/plot_Q/original