In a Seaborn scatter plot, I can adjust the spacing in the legend entries like so:
tips = sns.load_dataset('tips')
g = sns.scatterplot(data=tips, x="total_bill", y="tip", hue="time")
plt.legend(labelspacing=20)
How can I do this with a CDF plot? Running g = sns.ecdfplot(data=tips, x="total_bill", hue="time")
gives a plot with the legend. I have tried the following without any luck.
plt.legend(labelspacing=20)
- Finishes plot but removes the legend
- Throws error
No handles with labels found to put in legend.
g.get_legend().legend(labelspacing=20)
- Doesn't plot
- Throws
AttributeError: 'Legend' object has no attribute 'legend'