Beispiel #1
0
def plot_2Dpmf(X, Y, xlabel, ylabel, title, saveas, bins=(100, 100)):
    cubecmap.set_bad(color="lightgray", alpha=1.)
    plt.figure()
    z, x, y = np.histogram2d(X, Y, bins=bins)
    F = -np.log(z)
    F -= F.min()
    extent = [x[0], x[-1], y[0], y[-1]]
    F = np.ma.masked_invalid(F)
    ax1 = plt.contourf(F.T, 100, extent=extent, cmap=cubecmap)
    plt.xlabel(xlabel, fontsize=16)
    plt.ylabel(ylabel, fontsize=16)
    cbar = plt.colorbar()
    cbar.ax.set_ylabel('Free energy (k$_B$T)', fontsize=15)
    plt.title(title, fontsize=16)
    if saveas is not None:
        plt.savefig(saveas + ".png", bbox_inches="tight")
        plt.savefig(saveas + ".pdf", bbox_inches="tight")
        plt.savefig(saveas + ".eps", bbox_inches="tight")
Beispiel #2
0
def plot_2Dpmf(X,Y,xlabel,ylabel,title,saveas,bins=(100,100)):
    cubecmap.set_bad(color="lightgray",alpha=1.)
    plt.figure()
    z,x,y = np.histogram2d(X,Y,bins=bins)
    F = -np.log(z)
    F -= F.min()
    extent = [x[0], x[-1], y[0], y[-1]]
    F = np.ma.masked_invalid(F)
    ax1 = plt.contourf(F.T,100,extent=extent,cmap=cubecmap)
    plt.xlabel(xlabel,fontsize=16)
    plt.ylabel(ylabel,fontsize=16)
    cbar = plt.colorbar()
    cbar.ax.set_ylabel('Free energy (k$_B$T)',fontsize=15)
    plt.title(title,fontsize=16)
    if saveas is not None:
        plt.savefig(saveas+".png",bbox_inches="tight")
        plt.savefig(saveas+".pdf",bbox_inches="tight")
        plt.savefig(saveas+".eps",bbox_inches="tight")
Beispiel #3
0
def plot_weights(C, coordname, title, saveas, shift):
    C = np.ma.masked_invalid(C)
    cubecmap.set_bad(color="lightgray", alpha=1.)
    rwb = plt.get_cmap("bwr_r")
    rwb.set_bad(color="lightgray", alpha=1.)
    #shifted_cmap = shiftedColorMap(rwb, midpoint=shift, name='shifted')
    plt.figure()
    #plt.pcolormesh(C,cmap=cubecmap)
    plt.pcolormesh(C, cmap=rwb, vmin=-0.1, vmax=0.1)
    cbar = plt.colorbar()
    cbar.ax.set_ylabel('Contact weight on %s' % coordname, fontsize=15)
    plt.xlabel("Residue i", fontsize=16)
    plt.ylabel("Residue j", fontsize=16)
    plt.xlim(0, C.shape[0])
    plt.ylim(0, C.shape[0])
    plt.title(title, fontsize=16)
    if saveas is not None:
        plt.savefig(saveas + ".png", bbox_inches="tight")
        plt.savefig(saveas + ".pdf", bbox_inches="tight")
        plt.savefig(saveas + ".eps", bbox_inches="tight")
Beispiel #4
0
def plot_weights(C,coordname,title,saveas,shift):
    C = np.ma.masked_invalid(C)
    cubecmap.set_bad(color="lightgray",alpha=1.)
    rwb = plt.get_cmap("bwr_r")
    rwb.set_bad(color="lightgray",alpha=1.)
    #shifted_cmap = shiftedColorMap(rwb, midpoint=shift, name='shifted')
    plt.figure()
    #plt.pcolormesh(C,cmap=cubecmap)
    plt.pcolormesh(C,cmap=rwb,vmin=-0.1,vmax=0.1)
    cbar = plt.colorbar()
    cbar.ax.set_ylabel('Contact weight on %s' % coordname,fontsize=15)
    plt.xlabel("Residue i",fontsize=16)
    plt.ylabel("Residue j",fontsize=16)
    plt.xlim(0,C.shape[0])
    plt.ylim(0,C.shape[0])
    plt.title(title,fontsize=16)
    if saveas is not None:
        plt.savefig(saveas+".png",bbox_inches="tight")
        plt.savefig(saveas+".pdf",bbox_inches="tight")
        plt.savefig(saveas+".eps",bbox_inches="tight")