Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Let's Cope with Axes | Plot Customization
First Dive into seaborn Visualization

bookLet's Cope with Axes

Setting label names:

To set label names, we need to set a plot variable and use:

# g is the plot variable.
g.set(xlabel = 'x_name', ylabel = 'y_name')

X(y)ticks rotation:

To rotate labels, we need to use:

# n is the angle
plt.xticks(rotation = n)
plt.yticks(rotation = n)
Tâche

Swipe to start coding

  1. Import seaborn with sns alias.
  2. Import matplotlib.pyplot with plt alias.
  3. Import pandas with pd alias.
  4. Set label names 'Population'(Oy axis) & 'Years(2012-2022)'(Ox axis).
  5. Rotate labels along the Ox axis by 45 degrees.
  6. Show the plot.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 3
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

Awesome!

Completion rate improved to 5.88

bookLet's Cope with Axes

Glissez pour afficher le menu

Setting label names:

To set label names, we need to set a plot variable and use:

# g is the plot variable.
g.set(xlabel = 'x_name', ylabel = 'y_name')

X(y)ticks rotation:

To rotate labels, we need to use:

# n is the angle
plt.xticks(rotation = n)
plt.yticks(rotation = n)
Tâche

Swipe to start coding

  1. Import seaborn with sns alias.
  2. Import matplotlib.pyplot with plt alias.
  3. Import pandas with pd alias.
  4. Set label names 'Population'(Oy axis) & 'Years(2012-2022)'(Ox axis).
  5. Rotate labels along the Ox axis by 45 degrees.
  6. Show the plot.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

close

Awesome!

Completion rate improved to 5.88
Section 3. Chapitre 3
single

single

some-alt