In [1]:
%matplotlib inline
from ggplot import *

import pandas as pd
import numpy as np
In [2]:
df = pd.DataFrame(dict(
    x=np.random.normal(0, 1, 1000),
    y=np.random.normal(0, 1, 1000),
    w=np.random.uniform(-1, 1, 1000)
))
df.head()
Out[2]:
w x y
0 -0.810393 -1.020157 -0.569955
1 -0.883547 -1.155482 0.052136
2 0.450729 -0.740759 0.468624
3 0.198120 -0.382605 0.299596
4 -0.959025 0.574729 0.494365
In [3]:
ggplot(df, aes(x='x', y='y', fill='w')) + geom_tile()
Out[3]:
<ggplot: (284506149)>
In [4]:
ggplot(df, aes(x='x', y='y', fill='w')) + geom_bin2d()
Out[4]:
<ggplot: (285986533)>
In [5]:
ggplot(df, aes(x='x', y='y', fill='w')) + geom_tile(ybins=5)
Out[5]:
<ggplot: (290980241)>
In [7]:
ggplot(df, aes(x='x', y='y', fill='w')) + geom_tile(xbins=8, ybins=10)
Out[7]:
<ggplot: (292341169)>
In [ ]: