I am trying to plot a scatter
plot in pandas
with seaborn
package. I want both of my variables to show in legend, but I am only getting one. Following is a what I did:
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
df = pd.DataFrame(np.random.randn(100, 6), columns=['a', 'b', 'c', 'd', 'e', 'f'])
I plotted like this,
plt.scatter(df['a'],df['b'], color = ['red', 'blue'])
plt.legend(loc = 'best')
plt.show()
As you can see, I do not see a
column/object with blue color. What mistake am I making here? I searched on this, no luck yet. Any suggestion would be appreciated.