How to plot a Python Dataframe with category values like this picture?
Question: ![enter image description here](http://i.stack.imgur.com/sXOdd.png)

How can I achieve that using matplotlib?


Answer: Here is my code with the data you provided. As there's no class [they are all
different, despite your first example in your question does have classes], I
gave colors based on the numbers. You can definitely start alone from here,
whatever result you want to achieve. You just need `pandas`, `seaborn` and
`matplotlib`:

    
    
    import pandas as pd
    import seaborn as sns
    import matplotlib.pyplot as plt
    
    # import xls
    df=pd.read_excel('data.xlsx')
    # exclude Ranking values
    df1 = df.ix[:,1:-1]
    # for each element it takes the value of the xls cell
    df2=df1.applymap(lambda x: float(x.split('\n')[1]))
    
    # now plot it
    df_heatmap = df2
    fig, ax = plt.subplots(figsize=(15,15))
    sns.heatmap(df_heatmap, square=True, ax=ax, annot=True, fmt="1.3f")
    plt.yticks(rotation=0,fontsize=16);
    plt.xticks(fontsize=12);
    plt.tight_layout()
    plt.savefig('dfcolorgraph.png')
    

Which produces the following picture.
[![result](http://i.stack.imgur.com/sWdEK.png)](http://i.stack.imgur.com/sWdEK.png)

