import pandas as pd
import numpy as np
n = 10000
df=pd.DataFrame({'x': np.random.randn(n),
'y': np.random.randn(n)})
ax=df.plot.hexbin(x='x',y='y',gridsize=20)

df.plot.hexbin(x='x',y='y',gridsize=20,figsize=(6,3))
df.plot.hexbin(x='x',y='y',gridsize=20,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.hexbin(x='x',y='y',gridsize=20,title='hexbin Plot',color=[(.9,.2,.6)])
df.plot.hexbin(x='x',y='y',gridsize=20,title='grid=True',grid=True)
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.hexbin(x='x',y='y',gridsize=20,title='loglog=True',loglog=True)
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.