如何从Seaborn 0.11+中获取没有填充的标记

时间:2020-09-15 02:48:33

标签: python plot data-visualization seaborn

"crumbs": [ { "link": { "path": "/pokemon/type/pokemon?lang=en", "wid": "tablePokemon" }, "name": "Pokemon" } ], "data": { "records": [ { "id": "Pikachu", "link": { "path": "/pokemon/type/eletric/pikachu", "wid": "tableEletric" }, "available": "true", }, { "id": "Bulbasaur", "link": { "path": "/pokemon/type/grass/bulbasaur", "wid": "tableGrass" }, "available": "true", } ] } 有一个matplotlib.pyplot.scatter()参数,该参数将使数据点在内部呈空心。如何为facecolors=None获得相同的外观?

在先前版本的seaborn中发现了相同的论点,但由于最新版本(0.11)出于某种原因将其删除。

1 个答案:

答案 0 :(得分:1)

  • 由于seabornmatplotlib的高级API,因此这似乎反映了matplotlib中的功能
  • 根据JointGrid documentation中的示例,参数为fc。要使用fc,您还应该使用ec
    • 指定fc='none'而不指定ec将导致空白标记。
  • 'None''none'均有效,但None无效。
import seaborn as sns

# load data
penguins = sns.load_dataset("penguins", cache=False)

# set x and y
x, y = penguins["bill_length_mm"], penguins["bill_depth_mm"]

# plot
sns.jointplot(data=penguins, x="bill_length_mm", y="bill_depth_mm", ec="g", fc="none")

enter image description here