seaborn.FacetGrid.map_dataframe

优质
小牛编辑
135浏览
2023-12-01
FacetGrid.map_dataframe(func, *args, **kwargs)

Like .map but passes args as strings and inserts data in kwargs.

This method is suitable for plotting with functions that accept a long-form DataFrame as a <cite>data</cite> keyword argument and access the data in that DataFrame using string variable names.

参数:func:callable

A plotting function that takes data and keyword arguments. Unlike the <cite>map</cite> method, a function used here must “understand” Pandas objects. It also must plot to the currently active matplotlib Axes and take a <cite>color</cite> keyword argument. If faceting on the <cite>hue</cite> dimension, it must also take a <cite>label</cite> keyword argument.

args:strings

Column names in self.data that identify variables with data to plot. The data for each variable is passed to <cite>func</cite> in the order the variables are specified in the call.

kwargs:keyword arguments

All keyword arguments are passed to the plotting function.

返回值:self:object

Returns self.