Hello everyone,
In the chart above, how do I remove the fourth panel?
Here is the code. Any ideas?
panel, ax = plt.subplots(2,2) ax[0,0].scatter(df[:,0],df[:,1],s=50) ax[0,0].set_title('Original Scatter (middle 90%)') ax[0,0].set_xlabel('Diversification index', fontsize=8) ax[0,0].set_ylabel('PPP per capita', fontsize=8) ax[0,1].plot(K, bss/tss*100, 'b*-') ax[0,1].plot([0,20],[90,90],'k-', color='red') ax[0,1].set_title('Optimal number of clusters') ax[0,1].set_xlabel('Number of clusters', fontsize=8) ax[0,1].set_ylabel('% variance explained', fontsize=8) ax[0,1].text(0.95,0.01, 'Elbow for KMeans clustering', verticalalignment='bottom', horizontalalignment='right', transform=ax[0,1].transAxes, color='red', fontsize=8) clr = ['b','g','r','c','m','y','k'] for i in range(K[kIdx-1]): ind = (cIdx[kIdx-1]==i) ax[1,0].scatter(df[ind,0],df[ind,1], s=30, c=clr[i], label='Cluster %d'%i) ax[1,0].set_xlabel('Diversification index', fontsize=8) ax[1,0].set_ylabel('GDP',fontsize=8) ax[1,0].set_title('KMeans clustering with K=%d' % K[kIdx-1]) box = ax[1,0].get_position() ax[1,0].set_position([box.x0, box.y0, box.width*0.8, box.height]) ax[1,0].legend(loc='center left',bbox_to_anchor=(1,0.5), fancybox=True, shadow=True) 