(X, label, title=None)
| 16 | colormap = plt.cm.gist_ncar #nipy_spectral, Set1,Paired |
| 17 | colorst = [colormap(i) for i in np.linspace(0, 0.9, N)] |
| 18 | def plot_embedding(X, label, title=None): |
| 19 | plt.figure() |
| 20 | ax = plt.subplot(111) |
| 21 | #color_dict = {0:'b',1:'r'} |
| 22 | for i in range(N): |
| 23 | inds = np.where(label==i)[0] |
| 24 | plt.scatter(X[inds, 0], X[inds, 1],color=colorst[i],label=str(i)) |
| 25 | |
| 26 | ax.tick_params(labelbottom="off", bottom="off") |
| 27 | ax.tick_params(labelleft="off", left="off") |
| 28 | plt.tick_params(color='white') |
| 29 | ax.spines["right"].set_color("none") |
| 30 | ax.spines["left"].set_color("none") |
| 31 | ax.spines["top"].set_color("none") |
| 32 | ax.spines["bottom"].set_color("none") |
| 33 | #ax.legend(loc='upper left') |
| 34 | #plt.legend() |
| 35 | plt.savefig(title) |
| 36 | return X#(X - x_min) / (x_max - x_min) |
| 37 | def plot_embedding2(X, label, title=None): |
| 38 | plt.figure() |
| 39 | ax = plt.subplot(111) |
no outgoing calls
no test coverage detected