making matplotlib scatter plots from dataframes in Python's pandas
https://stackoverflow.com/questions/14300137/making-matplotlib-scatter-plots-from-dataframes-in-pythons-pandas
WebJan 13, 2013 · colors = np.where(df.col3 > 300, 'r', 'k') plt.scatter(df.col1, df.col2, s=120, c=colors) # OR (with pandas 0.13 and up) df.plot(kind='scatter', x='col1', y='col2', s=120, c=colors) Scatter plot with legend. However, the easiest way I've found to create a scatter plot with legend is to call plt.scatter once for each point type.
DA: 8 PA: 21 MOZ Rank: 49