Matplotlib: Add color legend to scatter plot
问题 Have table as: import matplotlib.pyplot as plt import pandas as pd import numpy as np list_1=[['AU',152,474.0], ['CA',440,482.0], ['DE',250,564.0,], ['ES',707,549.0,], ['FR',1435,551.0,], ['GB',731,555.0,], ['IT',979,600.0,], ['NDF',45041,357.0,], ['NL',247,542.0,], ['PT',83,462.0,], ['US',20095,513.0,], ['other',3655,526.0,]] labels=['country_destination','num_users','avg_hours_spend'] df=pd.DataFrame(list_1,columns=labels) df=df.set_index('country_destination') df country_destination num