【问题标题】:Change the marker of stripplot seaborn to be a string, not a marker将 stripplot seaborn 的标记更改为字符串,而不是标记
【发布时间】:2016-10-22 07:20:00
【问题描述】:

我有一个这样的熊猫数据框:

NAME POSITION VALUE A 123 0.1 B 34 0.8

如果使用 stripplot 创建绘图,有没有办法让点实际上是 NAME 中的对应值?

例如,教程中的图 (https://stanford.edu/~mwaskom/software/seaborn/tutorial/categorical.html) 显示了此图。是否可以将这些点替换为另一列中的字符串,例如“NAME”中的字符串?

【问题讨论】:

    标签: python pandas plot seaborn


    【解决方案1】:

    为了将来参考,可以通过 Dollars($) 将标记设置为任何字符串。

    sns.lineplot(data,marker="$string$")

    您可能还应该使用标记大小以使其更漂亮。

    sns.lineplot(data,marker="$string$", markersize=10)

    【讨论】:

      猜你喜欢
      • 2021-11-17
      • 2013-07-07
      • 2021-12-22
      • 1970-01-01
      • 2012-12-16
      • 1970-01-01
      • 2021-10-01
      • 1970-01-01
      • 2017-06-30
      相关资源
      最近更新 更多