def scatter_plot(data, x, y, by=None, ax=None, figsize=None, grid=False,<EOL>**kwargs):
import matplotlib.pyplot as plt<EOL>kwargs.setdefault('<STR_LIT>', '<STR_LIT:none>')<EOL>def plot_group(group, ax):<EOL><INDENT>xvals = group[x].values<EOL>yvals = group[y].values<EOL>ax.scatter(xvals, yvals, **kwargs)<EOL>ax.grid(grid)<EOL><DEDENT>if by is not None:<EOL><INDENT>fig = _grouped_plot(plot_group, data, by=by, figsize=figsize, ax=ax)<EOL><DEDENT>else:<EOL><INDENT>if ax is None:<EOL><INDENT>fig = plt.figure()<EOL>ax = fig.add_subplot(<NUM_LIT>)<EOL><DEDENT>else:<EOL><INDENT>fig = ax.get_figure()<EOL><DEDENT>plot_group(data, ax)<EOL>ax.set_ylabel(pprint_thing(y))<EOL>ax.set_xlabel(pprint_thing(x))<EOL>ax.grid(grid)<EOL><DEDENT>return fig<EOL>
Make a scatter plot from two DataFrame columns

Parameters
----------
data : DataFrame
x : Column name for the x-axis values
y : Column name for the y-axis values
ax : Matplotlib axis object
figsize : A tuple (width, height) in inches
grid : Setting this to True will show the grid
kwargs : other plotting keyword arguments
    To be passed to scatter function

Returns
-------
matplotlib.Figure