import pandas as pd
my_dict={
'Sale':[80,90,75,80,85,80,75],
'cost':[50,40,55,45,65,60,55],
'prof':[8,12,13,10,9,12,13]
}
df =pd.DataFrame(data=my_dict)
df.plot.area(title='Area Plot')

df.plot.area(figsize=(6,3))
df.plot.area(fontsize=20)
We can use the option colors to give different colors to line . We can use one tuple to define the colours.
my_color=[(.9,.4,.3),(.1,.8,.1),(.1,.5,.9)]
df.plot.area(title='Area Plot',color=my_color)
#my_style=[':']
my_style=['.-']
df.plot.area(title='style',style=my_style)
df.plot.area(title='grid=True',grid=True)
We can specify log scaling or symlog scaling for x ( logx=True )
df.plot.area(logx=True)
df.plot.area(secondary_y=True)
df.plot.area(title='mark_right=False',secondary_y=True,mark_right=True,alpha=.4)
df.plot.area(title='rot=180',rot=180)
Pandas plot
plot.barh()
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.