def heatmap(<EOL>self,<EOL>x,<EOL>y,<EOL>C=None,<EOL>reduce_C_function="<STR_LIT>",<EOL>gridsize=<NUM_LIT:100>,<EOL>alpha=None,<EOL>width=<NUM_LIT>,<EOL>height=<NUM_LIT>,<EOL>ax=None,<EOL>**kwds<EOL>):
<EOL>reduce_C_function = validate_aggregation(reduce_C_function)<EOL>if C is None:<EOL><INDENT>df = self._data[[x, y]]<EOL><DEDENT>else:<EOL><INDENT>df = self._data[[x, y, C]]<EOL><DEDENT>if C is None:<EOL><INDENT>color = alt.Color(aggregate="<STR_LIT:count>", type="<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>color = alt.Color(field=C, aggregate=reduce_C_function, type="<STR_LIT>")<EOL><DEDENT>color.scale = alt.Scale(scheme="<STR_LIT>")<EOL>chart = self._plot(<EOL>data=df,<EOL>width=width,<EOL>height=height,<EOL>title=kwds.pop("<STR_LIT:title>", "<STR_LIT>"),<EOL>figsize=kwds.pop("<STR_LIT>", None),<EOL>dpi=kwds.pop("<STR_LIT>", None),<EOL>).mark_rect().encode(<EOL>x=alt.X(x, bin=alt.Bin(maxbins=gridsize), type="<STR_LIT>"),<EOL>y=alt.Y(y, bin=alt.Bin(maxbins=gridsize), type="<STR_LIT>"),<EOL>color=color,<EOL>)<EOL>if alpha is not None:<EOL><INDENT>assert <NUM_LIT:0> <= alpha <= <NUM_LIT:1><EOL>chart = chart.encode(opacity=alt.value(alpha))<EOL><DEDENT>if ax is not None:<EOL><INDENT>return ax + chart<EOL><DEDENT>warn_if_keywords_unused("<STR_LIT>", kwds)<EOL>return chart<EOL>
Heatmap plot for DataFrame data

        Note that Vega-Lite does not support hexagonal binning, so this method
        returns a cartesian heatmap.

        >>> dataframe.vgplot.hexbin()  # doctest: +SKIP

        Parameters
        ----------
        x : string
            the column to use as the x-axis variable.
        y : string
            the column to use as the y-axis variable.
        C : string, optional
            the column to use to compute the mean within each bin. If not
            specified, the count within each bin will be used.
        reduce_C_function : string, default = 'mean'
            One of ['mean', 'sum', 'median', 'min', 'max', 'count'], or
            associated numpy or python builtin functions. Note that arbitrary
            callable functions are not supported.
        gridsize : int, optional
            the number of divisions in the x and y axis (default=100)
        alpha : float, optional
            transparency level, 0 <= alpha <= 1
        width : int, optional
            the width of the plot in pixels
        height : int, optional
            the height of the plot in pixels
        ax: altair.Chart, optional
            chart to be overlayed with this vis (convinience method for `chart1 + chart2`)

        Returns
        -------
        chart : alt.Chart
            altair chart representation