I have created three tricontour plots and have overlayed these plots as shown below:
finalDf = pca_cont('%_helix')
x1 = list(finalDf['pc1'])
y1 = list(finalDf['pc2'])
z1 = list(finalDf['%_helix'])
zf1 = threshold (z1, 0.60)
finalDf2 = pca_cont('%_sheet')
x2 = list(finalDf2['pc1'])
y2 = list(finalDf2['pc2'])
z2 = list(finalDf2['%_sheet'])
zf2 = threshold (z2, 0.60)
finalDf3 = pca_cont('%_coil')
x3 = list(finalDf3['pc1'])
y3 = list(finalDf3['pc2'])
z3 = list(finalDf3['%_coil'])
zf3 = threshold (z3, 0.90)
plt.figure(figsize = (16,16))
plt.tricontour(x1,y1,zf1,500,cmap="Reds", alpha=.5)
plt.tricontour(x2,y2,zf2,500,cmap="Greens", alpha=.5)
plt.tricontour(x3,y3,zf3,500,cmap="Blues", alpha=.5)
plt.xlabel("Principal Component 1")
plt.ylabel("Principal Component 2")
plt.title("100 Dimension Embedding")
plt.colorbar()
plt.show()
But my problem is that I have three sets of colours and various depths so when I add a colorbar using plt.colorbar()
it wont show all three. What is the best way to represent the three sets of data? Should I just plot a simple legend or is there a way to represent the three sets of data using three colorbars?
Thank you