Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def plot_clusters(df, row, col, scatter_x, scatter_y, hue, col_for_s, filename):
- g = sns.FacetGrid(df, row=row, col=col, hue=hue, aspect=1, size=4, palette='Set2')
- g.map(plt.scatter, scatter_x, scatter_y, alpha=0.8, edgecolor='white', linewidth=0.5, s=100+df[col_for_s]*20)
- fig = g.fig
- fig.subplots_adjust(top=0.8, wspace=0.3)
- l = g.add_legend(title=hue)
- fig.savefig(directory+filename, bbox_inches='tight', facecolor='w', transparent=False, pad_inches = 0.5)
Add Comment
Please, Sign In to add comment