ÎncepețiÎncepe gratuit

Axis labels!

In the last exercise, you made a nice histogram of petal lengths of Iris versicolor, but you didn't label the axes! That's ok; it's not your fault since we didn't ask you to. Now, add axis labels to the plot using plt.xlabel() and plt.ylabel(). Don't forget to add units and assign both statements to _. The packages matplotlib.pyplot and seaborn are already imported with their standard aliases. This will be the case in what follows, unless specified otherwise.

Acest exercițiu face parte din cursul

Statistical Thinking in Python (Part 1)

Vezi cursul

Instrucțiuni pentru exercițiu

  • Label the axes. Don't forget that you should always include units in your axis labels. Your \(y\)-axis label is just 'count'. Your \(x\)-axis label is 'petal length (cm)'. The units are essential!
  • Display the plot constructed in the above steps using plt.show().

Exercițiu interactiv practic

Încearcă acest exercițiu completând acest cod de exemplu.

# Plot histogram of versicolor petal lengths
_ = plt.hist(versicolor_petal_length)

# Label axes



# Show histogram

Editează și rulează codul