def map_data(self, func):
"""
Map the dataframe using :func:`func`.
This method wraps the function :func:`func` so that a facet is
plotted for the grouping variables. In order for this to work,
:func:`func` has to take two values: `data`, which is a sub-
dataframe after grouping, and `color`, which is currently not
used, but which must be handled by `func` anyway.
Technically, it calls :func:`FacetGrid.map_dataframe` from
`seaborn` with `func` as a parameter if more than one plot
is required. Otherwise, it calls `func` directly, as `FacetGrid`
can have problems if only one plot is drawn.
Parameters
----------
func : function
The plotting function.
"""
if self._col_factor:
self.g.map_dataframe(func)
else:
func(self._table, None)
评论列表
文章目录