Consider this plot:
import matplotlib.pyplot as plt
import seaborn as sns
Data = sns.load_dataset("tips")
g = sns.lmplot(x="total_bill", y="tip", hue="smoker", data = Data, legend_out = False, aspect = 2)
g.set(xlabel = "independent", ylabel = "dependent")
sns.despine(fig=None, ax=None, top=False, right=False, left=False, bottom=False, offset=None, trim=False)
plt.show()
Now if I add the settings:
sns.set(rc={'figure.figsize':(10,5)}, font_scale=1.5)
sns.set_style({'axes.facecolor':'white', 'grid.color': '.8', 'font.family':'Times New Roman'})
It removes the border which I want to keep:
I would appreciate if you could help me know what is th eproblem and how I can fix it.
Try use this (Python)
# Remove all borders
sns.despine(bottom = True, left = True)
plt.show()
Maybe you want to ignore seaborn's styling and just set the parameters you need directly?
import matplotlib.pyplot as plt
import seaborn as sns
rc = {'figure.figsize':(10,5),
'axes.facecolor':'white',
'axes.grid' : True,
'grid.color': '.8',
'font.family':'Times New Roman',
'font.size' : 15}
plt.rcParams.update(rc)
Data = sns.load_dataset("tips")
g = sns.lmplot(x="total_bill", y="tip", hue="smoker", data = Data, legend_out = False, aspect = 2)
g.set(xlabel = "independent", ylabel = "dependent")
sns.despine(fig=None, ax=None, top=False, right=False, left=False, bottom=False, offset=None, trim=False)
plt.show()
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