import seaborn as sns
sns.set(style="ticks")
exercise = sns.load_dataset("exercise")
g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise)
在上图中,有没有办法将其中一种线型绘制为虚线,例如将“休息”线绘制为虚线。
请您参考如下方法:
使用linestyles 参数并选择desired type of line根据 matplotlib:
import seaborn as sns
import matplotlib.pylab as plt
sns.set(style="ticks")
exercise = sns.load_dataset("exercise")
g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise, linestyles=[":", "-","-"])
plt.show()
