def plot_swarm(df, x, y, hue, tag='eda', directory=None):
r"""Display a Swarm Plot.
Parameters
----------
df : pandas.DataFrame
The dataframe containing the ``x`` and ``y`` features.
x : str
Variable name in ``df`` to display along the x-axis.
y : str
Variable name in ``df`` to display along the y-axis.
hue : str
Variable name to be used as hue, i.e., another data dimension.
tag : str
Unique identifier for the plot.
directory : str, optional
The full specification of the plot location.
Returns
-------
None : None.
References
----------
http://seaborn.pydata.org/generated/seaborn.swarmplot.html
"""
logger.info("Generating Swarm Plot")
# Generate the swarm plot
swarm_plot = sns.swarmplot(x=x, y=y, hue=hue, data=df)
swarm_fig = swarm_plot.get_figure()
# Save the plot
write_plot('seaborn', swarm_fig, 'swarm_plot', tag, directory)
#
# Time Series Plots
#
#
# Function plot_time_series
#
评论列表
文章目录