I have multiple dimensional data set (6D), I want to plot the dimension 2/2 and save them. But I have a problem with the save: if I use plt.show() I get a good plot in the save_file if I don't use plt.show() I get an awfull flot with multiple superposition I try to figure out why

I have tried searching for the effect of plt.show on the plt.savefig but didn't found any useful information

for x in range(6):
    for y in range(6):
        if x != y:
            plt.scatter(data.T[x],data.T[y], s=50, linewidth=0, c=cluster_member_colors, alpha=0.25)
            plt.xlabel(reading_axis[x])
            plt.ylabel(reading_axis[y])
            plt.title(str(chip_id)+'\n ' + str(chamber_ID) + '\n '+reading_axis[x]+"vs"+reading_axis[y])
            plt.savefig(save_plot_path+'/'+reading_axis[x]+"vs"+ reading_axis[y])
            plt.show()
            #if i remove plt.show(), the plt.savefig will save a different plot

I haven't figure yet how to post screenshot or png on stack overflow yet but to explain what I see:

I try with and without plt.show(): with I get 4 clusters easy to differentiate without I get 14 clusters where 10 of them are different from the 4 previous one

0 Answers