how can I change the edges of the frames for legends generated in matplotlib from round to having sharp corners?
Let's use set_boxstyle
:
from seaborn import load_dataset
import matplotlib.pyplot as plt
df = load_dataset('tips')
df.head()
ax = df.plot('sex',['total_bill','tip'])
ax.legend().get_frame().set_boxstyle('Round', pad=0.2, rounding_size=2)
Output:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With