Plots
You will now create a figure in which you can visualize the departure delay by origin and the average total delay by carrier.
Este ejercicio forma parte del curso
Python for R Users
Instrucciones del ejercicio
- Create a figure with two axes (2 rows and 1 column).
- Use seaborn and
flights
to create a boxplot of'origin'
and'dep_delay'
on x and y axes, respectively. - Use seaborn and
tdel_car
to create a bar plot of'carrier'
and'total_delay'
on x and y axes, respectively. - Label the boxplot: 'Originating airport and the departure delay'.
Ejercicio interactivo práctico
Prueba este ejercicio completando el código de muestra.
# Create a figure
fig, (ax1, ax2) = plt.subplots(____)
# Boxplot and barplot in the axes
sns.____(x=____, y=____, data=flights, ax=____)
sns.____(x=____, y=____, data=tdel_car, ax=____)
# Label axes
ax1.set_title(____)
# Use tight_layout() so the plots don't overlap
fig.tight_layout()
plt.show()