Removing spines
In general, visualizations should minimize extraneous markings so that the data speaks for itself. Seaborn allows you to remove the lines on the top, bottom, left and right axis, which are often called spines.
Cet exercice fait partie du cours
<cours>Intermediate Data Visualization with Seaborn</cours>Instructions de l’exercice
- Use a
whitestyle for the plot. - Create a
lmplot()comparing thepop2010and thefmr_2columns. - Remove the top and right spines using
despine().
Exercice interactif pratique
Essayez cet exercice en complétant ce code d’exemple.
# Set the style to white
sns.set_style('____')
# Create a regression plot
sns.lmplot(data=df,
x='pop2010',
y='fmr_2')
# Remove the spines
sns.____()
# Show the plot and clear the figure
plt.show()
plt.clf()