IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Intermediate Data Visualization with Seaborn

Visualizza il corso

Istruzioni dell'esercizio

  • Use a white style for the plot.
  • Create a lmplot() comparing the pop2010 and the fmr_2 columns.
  • Remove the top and right spines using despine().

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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()
Modifica ed esegui il codice