0

Can someone spot the really quick fix to my problem? I'm trying to plot two distributions on the same figure using the Seaborn package. I'd like for one line to be red and the other blue. The way I have my for-loop set up now only produces blue lines. X and Y are 1-d arrays with data that I am plotting.

fig, ax = plt.subplots(1)

colors = ['r','b']

for a in [x, y]:
    for i in range(2):
        sns.distplot(a, bins=range(1, 25, 1), ax=ax,
        kde=True, hist=False, color=colors[i])
JAG2024
  • 2,723
  • 5
  • 18
  • 43

0 Answers0