Given the following data frame and pivot table:
import pandas as pd df=pd.DataFrame({'A':['a','a','a','a','a','b','b','b','b'], 'B':['x','y','z','x','y','z','x','y','z'], 'C':['a','b','a','b','a','b','a','b','a'], 'D':[7,5,3,4,1,6,5,3,1]}) table = pd.pivot_table(df, index=['A', 'B','C'],aggfunc='sum') table D A B C a x a 7 b 4 y a 1 b 5 z a 3 b x a 5 y b 3 z a 1 b 6 I'd like to create a heat map with divisions per indices A and B like this:
Is it possible?

