import pandas as pd
my_dict={
'visit':[50,53,55,57,59,60,61],
'sale':[8,9,11,12,14,16,17]
}
df =pd.DataFrame(data=my_dict)
df.plot.scatter(title='Sale Vs Visit',x='visit',y='sale')

df.plot.scatter(figsize=(6,3),x='visit',y='sale')
df.plot.scatter(x='visit',y='sale',fontsize=20)
We can use the option colors to give different colors to points . We can use one tuple to define the colours. Here it is color=[(.9,.4,.2)], this is in R G B format where each value varies from 0 to 1.
df.plot.scatter(title='Sale',x='visit',y='sale',color=[(.9,.4,.2)])
df.plot.scatter(title='grid=True',x='visit',y='sale',grid=True)
We can specify log scaling or symlog scaling for x ( logx=True ) or log scaling for y ( logy=True ), we can specify both the axis by loglog ( loglog=True)
df.plot.scatter(loglog=True,x='visit',y='sale')
df.plot.scatter(title='rot=180',x='visit',y='sale')
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.