Guest User

Untitled

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