在Seaborn Factorplot中更改标记大小

can*_*289 6 matplotlib seaborn

我正在尝试更改Seaborn factorplots中的标记大小,但我不确定要通过哪个关键字参数

import seaborn as sns
exercise = sns.load_dataset("exercise")
g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise, ci= .95)
Run Code Online (Sandbox Code Playgroud)

我尝试传递基于这些StackOverFlow答案的markersizes,但似乎都没有效果

Seaborn_Example

pyplot散点图标记大小

小智 9

Factorplotpointplot在默认情况下调用底层函数接受参数markers.这用于区分标记形状.可以使用scale参数更改所有线条和标记的大小.

exercise = sns.load_dataset("exercise")
g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise, ci=95, 
               markers=['o', 'v', 's'], 
               scale = 1.5)
Run Code Online (Sandbox Code Playgroud)

与上述相同的数据具有不同的形状

还请注意ci你的例子中的论点,.95会产生一个不同的数字,ci几乎看不到.

  • 如果你在factorplot中使用`kind ='swarm'`,`scale`会抛出一个错误但是在这种情况下使用关键字参数`s`会起作用 (3认同)