import seaborn as sns
sns.set(style="ticks")
exercise = sns.load_dataset("exercise")
g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise)在上面的绘图中,是否有一种方法可以将其中一种线型绘制为虚线,例如,将'rest‘线绘制为虚线。
发布于 2017-08-07 16:12:27
使用linestyles参数并根据matplotlib选择desired type of line:
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()

https://stackoverflow.com/questions/45540863
复制相似问题