BaşlayınÜcretsiz Başlayın

Polishing up a figure

Since plt.subplots() returns axes object, you can use the .set_title(), .set_xlabel(), and .set_ylabel() methods to add labels to your figure.

Bu egzersiz

Python for R Users

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use the .set_title() method on the axes to label the plot: 'Histogram'.
  • Use the .set_xlabel() method on the axes to label the plot: 'Total Bill'.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

import matplotlib.pyplot as plt
import seaborn as sns

# Create a figure with 1 axes
fig, ax = plt.subplots()

# Draw a histplot
ax = sns.histplot(tips['total_bill'], kde = True)

# Label the title and x axis
ax.____(____)
____
plt.show()
Kodu Düzenle ve Çalıştır