# Buggy code
def map(self, func, *args, **kwargs):
    """
    Apply a plotting function to each facet's subset of the data.

    Parameters
    ----------
    func : callable
        A plotting function that takes data and keyword arguments. It
        must plot to the currently active matplotlib Axes and take a
        `color` keyword argument. If faceting on the `hue` dimension,
        it must also take a `label` keyword argument.
    args : strings
        Column names in self.data that identify variables with data to
        plot. The data for each variable is passed to `func` in the
        order the variables are specified in the call.
    kwargs : keyword arguments
        All keyword arguments are passed to the plotting function.

    Returns
    -------
    self : FacetGrid object

    """
    import matplotlib.pyplot as plt

    for ax, namedict in zip(self.axes.flat, self.name_dicts.flat):
        if namedict is not None:
            data = self.data.loc[namedict]
            plt.sca(ax)
            innerargs = [data[a].values for a in args]
            # TODO: is it possible to verify that an artist is mappable?
            mappable = func(*innerargs, **kwargs)
            self._mappables.append(mappable)

    self._finalize_grid(*args[:2])

    return self


# Traceback (TypeError)
$ cat mwe.py
#!/usr/bin/env python3.6

import xarray
import numpy

da = xarray.DataArray(
numpy.arange(3*4).reshape(3,4),
dims=("x", "y"),
coords={"x": [1,2,3],
"y": [numpy.datetime64(f"2000-01-{x:02d}")
for x in range(1, 5)]})

da.plot.pcolormesh()
$ ./mwe.py
Traceback (most recent call last):
File "./mwe.py", line 13, in <module>
da.plot.pcolormesh()
File "/dev/shm/gerrit/venv/stable-3.6/lib/python3.6/site-packages/xarray/plot/plot.py", line 547, in plotmethod
return newplotfunc(**allargs)
File "/dev/shm/gerrit/venv/stable-3.6/lib/python3.6/site-packages/xarray/plot/plot.py", line 500, in newplotfunc
**kwargs)
File "/dev/shm/gerrit/venv/stable-3.6/lib/python3.6/site-packages/xarray/plot/plot.py", line 667, in pcolormesh
primitive = ax.pcolormesh(x, y, z, **kwargs)
File "/dev/shm/gerrit/venv/stable-3.6/lib/python3.6/site-packages/matplotlib/__init__.py", line 1710, in inner
return func(ax, *args, **kwargs)
File "/dev/shm/gerrit/venv/stable-3.6/lib/python3.6/site-packages/matplotlib/axes/_axes.py", line 5636, in pcolormesh
coords = np.column_stack((X, Y)).astype(float, copy=False)
File "/dev/shm/gerrit/venv/stable-3.6/lib/python3.6/site-packages/numpy/lib/shape_base.py", line 353, in column_stack
return _nx.concatenate(arrays, 1)
TypeError: invalid type promotion

# Fixed code
def map(self, func, *args, **kwargs):
    """
    Apply a plotting function to each facet's subset of the data.

    Parameters
    ----------
    func : callable
        A plotting function that takes data and keyword arguments. It
        must plot to the currently active matplotlib Axes and take a
        `color` keyword argument. If faceting on the `hue` dimension,
        it must also take a `label` keyword argument.
    args : strings
        Column names in self.data that identify variables with data to
        plot. The data for each variable is passed to `func` in the
        order the variables are specified in the call.
    kwargs : keyword arguments
        All keyword arguments are passed to the plotting function.

    Returns
    -------
    self : FacetGrid object

    """
    plt = import_matplotlib_pyplot()

    for ax, namedict in zip(self.axes.flat, self.name_dicts.flat):
        if namedict is not None:
            data = self.data.loc[namedict]
            plt.sca(ax)
            innerargs = [data[a].values for a in args]
            # TODO: is it possible to verify that an artist is mappable?
            mappable = func(*innerargs, **kwargs)
            self._mappables.append(mappable)

    self._finalize_grid(*args[:2])

    return self