gpt4 book ai didi

python - 如何更改群图中的标记大小

转载 作者:行者123 更新时间:2023-11-30 22:50:11 27 4
gpt4 key购买 nike

我想让我的群图中的数据点更大。我的代码是:

sns.swarmplot(x="Heart", y="FirstPersonPronouns", hue="Speech", data=df)
sns.set_context("notebook", font_scale=1.8)

我尝试过 scatter_kws 但得到:

Attribute error: unknown property scatter_kws.

最佳答案

来自 swarmplot 文档字符串:

Signature: seaborn.swarmplot(x=None, y=None, hue=None, data=None,
order=None, hue_order=None, split=False, orient=None, color=None,
palette=None, size=5, edgecolor='gray', linewidth=0, ax=None,
**kwargs)
Docstring: Draw a categorical scatterplot with non-overlapping points.
[snip]


Parameters
----------
x, y, hue : names of variables in ``data`` or vector data, optional
Inputs for plotting long-form data. See examples for interpretation.
data : DataFrame, array, or list of arrays, optional
Dataset for plotting. If ``x`` and ``y`` are absent, this is
interpreted as wide-form. Otherwise it is expected to be long-form. [snip]

然后:

size : float, optional
Diameter of the markers, in points. (Although ``plt.scatter`` is used
to draw the points, the ``size`` argument here takes a "normal"
markersize and not size^2 like ``plt.scatter``.

关于python - 如何更改群图中的标记大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39499576/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com