title: Seaborn catplot combined with PairGrid
body: <p>I am playing with the Titanic dataset, and trying to produce a pair plot of numeric variables against categorical variables. I can use Seaborn's <code>catplot</code> to graph a plot of one numeric variable against one categorical variable:</p>
  
  <pre><code>import seaborn as sns
  
  sns.catplot(data=train, x='Fare', y='Sex')
  </code></pre>
  
  <p>However, if I try to use PairGrid to graph numeric variables against categorical variables:</p>
  
  <pre><code>x_vars = ['Fare']
  y_vars = ['Sex']
  
  g = sns.PairGrid(train, x_vars=x_vars, y_vars=y_vars)
  g.map(sns.catplot)
  </code></pre>
  
  <p>It fails with an error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-75-c284a7cfd727&gt; in &lt;module&gt;
        9 #g.map_diag(lambda x, **kwargs: sns.catplot(x, x, **kwargs), jitter=True, kind="bar")
       10 #g.map(sns.scatterplot, y_jitter=1)#, hue=train["Survived"])
  ---&gt; 11 g.map(sns.catplot)#, hue=train["Survived"])
  
  ~/MLProject/book1/lib/python3.8/site-packages/seaborn/axisgrid.py in map(self, func, **kwargs)
     1363         row_indices, col_indices = np.indices(self.axes.shape)
     1364         indices = zip(row_indices.flat, col_indices.flat)
  -&gt; 1365         self._map_bivariate(func, indices, **kwargs)
     1366         return self
     1367 
  
  ~/MLProject/book1/lib/python3.8/site-packages/seaborn/axisgrid.py in _map_bivariate(self, func, indices, **kwargs)
     1504             y_var = self.y_vars[i]
     1505             ax = self.axes[i, j]
  -&gt; 1506             self._plot_bivariate(x_var, y_var, ax, func, kw_color, **kws)
     1507         self._add_axis_labels()
     1508 
  
  ~/MLProject/book1/lib/python3.8/site-packages/seaborn/axisgrid.py in _plot_bivariate(self, x_var, y_var, ax, func, kw_color, **kwargs)
     1534             color = self.palette[k] if kw_color is None else kw_color
     1535 
  -&gt; 1536             func(x, y, label=label_k, color=color, **kwargs)
     1537 
     1538         self._clean_axis(ax)
  
  ~/MLProject/book1/lib/python3.8/site-packages/seaborn/categorical.py in catplot(x, y, hue, data, row, col, col_wrap, estimator, ci, n_boot, units, seed, order, hue_order, row_order, col_order, kind, height, aspect, orient, color, palette, legend, legend_out, sharex, sharey, margin_titles, facet_kws, **kwargs)
     3760 
     3761     # Initialize the facets
  -&gt; 3762     g = FacetGrid(**facet_kws)
     3763 
     3764     # Draw the plot onto the facets
  
  ~/MLProject/book1/lib/python3.8/site-packages/seaborn/axisgrid.py in __init__(self, data, row, col, hue, col_wrap, sharex, sharey, height, aspect, palette, row_order, col_order, hue_order, hue_kws, dropna, legend_out, despine, margin_titles, xlim, ylim, subplot_kws, gridspec_kws, size)
      268         # Make a boolean mask that is True anywhere there is an NA
      269         # value in one of the faceting variables, but only if dropna is True
  --&gt; 270         none_na = np.zeros(len(data), np.bool)
      271         if dropna:
      272             row_na = none_na if row is None else data[row].isnull()
  
  TypeError: object of type 'NoneType' has no len()
  
  </code></pre>
  
  <p>If I replace <code>g.map(sns.catplot)</code> with <code>g.map(sns.scatterplot)</code> it does graph successfully without error.</p>
  
  <p>How can I combine <code>catplot</code> with <code>PairGrid</code>?</p>