Pd Df Plot Bar Different Color

[Solved] Pd Df Plot Bar Different Color | Php - Code Explorer | yomemimo.com
Question : pd df plot bar different color

Answered by : talented-tapir-o1gwsl4gtj3j

speed = [0.1, 17.5, 40, 48, 52, 69, 88]
>>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
>>> index = ['snail', 'pig', 'elephant',
... 'rabbit', 'giraffe', 'coyote', 'horse']
>>> df = pd.DataFrame({'speed': speed,
... 'lifespan': lifespan}, index=index)
>>> ax = df.plot.bar(rot=0)

Source : https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.bar.html | Last Update : Thu, 28 Apr 22

Answers related to pd df plot bar different color

Code Explorer Popular Question For Php