简体   繁体   中英

Plot dotted line in seaborn factorplot

import seaborn as sns
sns.set(style="ticks")
exercise = sns.load_dataset("exercise")
g = sns.factorplot(x="time", y="pulse", hue="kind", data=exercise)

In the plot above, is there a way to plot one of the line types as a dotted line, eg plot the 'rest' line as dotted.

Use linestyles argument and select desired type of line according to 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()

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM