Let'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)
Tarefa
Swipe to start coding
- Import
seabornwithsnsalias. - Import
matplotlib.pyplotwithpltalias. - Import
pandaswithpdalias. - Set label names
'Population'(Oy axis) &'Years(2012-2022)'(Ox axis). - Rotate labels along the Ox axis by 45 degrees.
- Show the plot.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 3
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Suggested prompts:
Resumir este capítulo
Explicar o código em file
Explicar por que file não resolve a tarefa
Awesome!
Completion rate improved to 5.88
Let's Cope with Axes
Deslize para mostrar o 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)
Tarefa
Swipe to start coding
- Import
seabornwithsnsalias. - Import
matplotlib.pyplotwithpltalias. - Import
pandaswithpdalias. - Set label names
'Population'(Oy axis) &'Years(2012-2022)'(Ox axis). - Rotate labels along the Ox axis by 45 degrees.
- Show the plot.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 3
single