How to plot a dashed line on seaborn lineplot?
问题 I'm simply trying to plot a dashed line using seaborn. This is the code I'm using and the output I'm getting import seaborn as sns import numpy as np import matplotlib.pyplot as plt n = 11 x = np.linspace(0,2,n) y = np.sin(2*np.pi*x) sns.lineplot(x,y, linestyle='--') plt.show() What am I doing wrong? Thanks 回答1: It seems that linestyle= argument doesn't work with lineplot() , and the argument dashes= is a bit more complicated than it might seem. A (relatively) simple way of doing it might be