CommencezCommencez gratuitement

Graphiques multiples

Pour ce dernier exercice, nous allons tracer une comparaison des loyers du marché équitable pour les appartements de 1 et de 2 chambres.

Cette activité fait partie du cours

Visualisation de données intermédiaire avec Seaborn

Voir le cours

Instructions de l’exercice

  • Créez deux objets axes, ax0 et ax1.
  • Tracez fmr_1 sur ax0 et fmr_2 sur ax1.
  • Affichez les graphiques côte à côte.

Exercice interactif pratique

Essayez cet exercice en complétant ce code d’exemple.

# Create a plot with 1 row and 2 columns that share the y axis label
fig, (ax0, ax1) = plt.subplots(nrows=____, ncols=____, sharey=____)

# Plot the distribution of 1 bedroom apartments on ax0
sns.histplot(df['____'], ax=____)
____.set(xlabel="1 Bedroom Fair Market Rent", xlim=(100,1500))

# Plot the distribution of 2 bedroom apartments on ax1
sns.histplot(df['____'], ax=____)
____.set(xlabel="2 Bedroom Fair Market Rent", xlim=(100,1500))

# Display the plot
plt.show()
Modifier et exécuter le code