Pandas applies a color palette for each row, which means that you get the same color for a frame with one column.
To apply different colors to each row of your data frame, you must generate a list of colors from the selected color map:
import pandas as pd import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np df = pd.DataFrame({'days':[172, 200, 400, 600]}) colors = cm.RdYlGn(np.linspace(0,1,len(df))) df['days'].plot(kind='barh', color=colors) plt.show()
Another method is to use matplotlib directly.
source share