_, breaks = np.histogram(df.MAT, bins=5)
ax = df.boxplot(column='N0_YLDF', by='Class')
ax.xaxis.set_ticklabels([('%s' % val) for i, val in enumerate(breaks) if i in
    df.Class])
Boxplot stratified by column in python pandas