import pandas as pd
my_dict={
'MATH':[30,33,32,32,31,34,32]
}
df=pd.DataFrame(data=my_dict)
df.plot.density()

df.plot.density(figsize=(6,3))
df.plot.density(fontsize=20)
We can use the option colors to give different colors to line . We can use one tuple to define the colours.
df.plot.density(color=[(.9,.3,.4)])
my_style=['-.']
#my_style=[':']
df.plot.density(style=my_style)
We can specify log scaling or symlog scaling for x ( logx=True ) or y ( logy=True ) or for both x & y ( loglog=True)
df.plot.density(loglog=True)
df.plot.density(secondary_y=True)
df.plot.density(mark_right=True,secondary_y=True)
df.plot.density(title='rot=180',figsize=(5,4),rot=180)
Pandas plot
plot.barh()
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.